github phan/phan 3.0.1
Release 3.0.1 supporting PHP 7.0-7.4 syntax

latest releases: 5.4.3, 5.4.2, 5.4.1...
3 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.

Don't miss a new phan release

NewReleases is sending notifications on new releases.