phan v3.0.1 Release Notes

Release Date: 2020-06-05 // almost 4 years ago
  • ๐Ÿ†• New features(Analysis):

    • ๐Ÿ‘Œ Support analysis of php 8.0's mixed type (#3899)
      ๐Ÿ†• New issue types: PhanCompatibleMixedType, PhanCompatibleUseMixed.
    • Treat static and false like real types and emit more severe issues in all php versions.
    • ๐Ÿ‘Œ Improve type inferences from negated type assertions (#3923)
      (analyze more expression kinds, infer real types in more places)
    • Warn about unnecessary use of expr ?? null. (#3925)
      ๐Ÿ†• New issue types: PhanCoalescingNeverUndefined.
    • ๐Ÿ‘Œ Support PHP 8.0 non-capturing catches (#3907)
      ๐Ÿ†• New issue types: PhanCompatibleNonCapturingCatch.
    • Infer type of $x->magicProp from the signature of __get
    • Treat functions/methods that are only called by themselves as unreferenced during dead code detection.
    • Warn about each() being deprecated when the target_php_version is php 7.2+. (#2746)
      ๐Ÿ—„ This is special cased because PHP does not flag the function itself as deprecated in ReflectionFunction.
      ๐Ÿ—„ (PHP only emits the deprecation notice for each() once at runtime)

    Miscellaneous:

    • Check for keys that are too long when computing levenshtein distances (when Phan suggests alternatives).

    ๐Ÿ”Œ Plugins:

    • โž• Add AnalyzeLiteralStatementCapability for plugins to analyze no-op string literals (#3911)
    • ๐Ÿ”Œ In PregRegexCheckerPlugin, warn if $ allows an optional newline before the end of the string
      when configuration includes ['plugin_config' => ['regex_warn_if_newline_allowed_at_end' => true]]) (#3915)
    • ๐Ÿ”Œ In SuspiciousParamOrderPlugin, warn if an argument has a near-exact name match for a parameter at a different position (#3929)
      E.g. warn about calling foo($b) or foo(true, $this->A) for function foo($a = false, $b = false).
      ๐Ÿ†• New issue types: PhanPluginSuspiciousParamPosition, PhanPluginSuspiciousParamPositionInternal

    ๐Ÿ› Bug fixes:

    • ๐Ÿ›  Fix false positive PhanTypeMismatchPropertyDefault involving php 7.4 typed properties with no default
      and generic comments (#3917)
    • ๐Ÿšš Don't remove leading directory separator when attempting to convert a file outside the project to a relative path.