packagist phan/phan 2.4.0
Release 2.4.0 supporting PHP 7.0-7.4 syntax

latest releases: v5.x-dev, dev-fix-4782, dev-MapReal-php81-82...
4 years ago

New features(CLI, Configs):

  • Support saving and loading baselines with --save-baseline=.phan/baseline.php and --load-baseline=.phan/baseline.php. (#2000)
    --save-baseline will save all pre-existing issues for the provided analysis settings to a file.
    When Phan is invoked later with --load-baseline, it will ignore any
    issue kinds in the files from file_suppressions in the baseline.

    This is useful for setting up analysis with Phan on a new project,
    or when enabling stricter analysis settings.

    Different baseline files can be used for different Phan configurations.
    (e.g. .phan/baseline_deadcode.php for runs with --dead-code-detection)

New features(Analysis):

  • Fix edge cases in checking if some nullable types were possibly falsey
    (?true and literal floats (e.g. ?1.1))
  • Emit PhanCoalescingNeverNull instead of PhanCoalescingNeverNullIn*
    if it's impossible for the node kind to be null. (#3386)
  • Warn about array destructuring syntax errors ([] = $arr, [$withoutKey, 1 => $withKey] = $arr)
  • Return a clone of an existing variable if one already exists in Variable::fromNodeInContext. (#3406)
    This helps analyze PassByReferenceVariables.
  • Don't emit PhanParamSpecial2 for min/max/implode/join with a single vararg. (#3396)
  • Properly emit PhanPossiblyInfiniteRecursionSameParams for functions with varargs.
  • Emit PhanNoopNew or PhanNoopNewNoSideEffects when an object is created with new expr(...) but the result is not used (#3410)
  • Emit PhanPluginUseReturnValueInternalKnown for about unused results of function calls on the right hand side of control flow operators (??/?:/&&/||) (#3408)

Don't miss a new phan release

NewReleases is sending notifications on new releases.