phan v3.2.1 Release Notes

Release Date: 2020-09-13 // over 3 years ago
  • ๐Ÿ†• New features (Analysis):

    • Don't compare parameter types against alternate method signatures which have too many required parameters.
      (e.g. warn about max([]) but not max([], [1]))
    • Support /** @unused-param $param_name */ in doc comments as an additional way to support suppressing warnings about individual parameters being unused.
    • Warn about loop conditions that potentially don't change due to the body of the loop.
      This check uses heuristics and is prone to false positives.
      ๐Ÿ†• New issue types: PhanPossiblyInfiniteLoop
    • Treat unset($x); as shadowing variable definitions during dead code detection.
    • ๐Ÿ”„ Change the way $i++, --$i, etc. are analyzed during dead code detection
    • Properly enable allow_method_param_type_widening by default when the inferred minimum_target_php_version is '7.2' or newer. (#4168)
    • ๐Ÿš€ Start preparing for switching to AST version 80 in an upcoming Phan 4 release. (#4167)`

    ๐Ÿ› Bug fixes:

    • ๐Ÿ›  Fix various crashes in edge cases.
    • ๐Ÿ›  Fix crash with adjacent named labels for gotos in the polyfill/fallback parser.
    • ๐Ÿ›  Fix false positive unused parameter warning with php 8.0 constructor property promotion.

    ๐Ÿ”Œ Plugins:

    • ๐Ÿ”Œ Warn about # comments in PHPDocInWrongCommentPlugin if they're not used for the expected #[ syntax of php 8.0 attributes.

    ๐Ÿšง Maintenance:

    • โšก๏ธ Update polyfill/fallback parser to properly skip attributes in php 8.0.
      ๐Ÿš€ The upcoming Phan 4 release will support analyzing attributes, which requires AST version 80.