packagist phan/phan 2.4.4
Release 2.4.4 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):

  • When stderr is redirected a file or to another program, show an append-only progress bar by default. (#3514)
    Phan would previously disable the progress bar entirely by default.

    The new --long-progress-bar CLI flag can be used to choose this progress bar.

    (The --no-progress-bar CLI flag or the environment variable PHAN_DISABLE_PROGRESS_BAR=1 can be used to disable this)

  • Treat $var = $x['possibly undefined offset'] as creating a definitely defined variable,
    not a possibly undefined variable. (#3534)

    The config setting convert_possibly_undefined_offset_to_nullable controls
    whether the field type gets cast to the nullable equivalent after removing undefined.

New features(Analysis):

  • Emit PhanPossiblyUndefinedArrayOffset for accesses to array fields that are possibly undefined. (#3534)
  • Warn about returning/not returning in void/non-void functions.
    New issue types: PhanSyntaxReturnValueInVoid, PhanSyntaxReturnExpectedValue
  • Infer that $var[$offset] = expr;/$this->prop[$offset] = expr; causes that element to be non-null (#3546)
  • Emit PhanEmptyForeachBody when iterating over a type that isn't Traversable with an empty statement list.
  • Warn about computing array_values for an array that is already a list. (#3540)
  • Infer the real type is still an array after assigning to a field of an array.

Plugins:

  • In DuplicateExpressionPlugin, emit PhanPluginDuplicateIfStatements
    if the body for else is identical to the above body for the if/elseif.

Maintenance:

  • Support native parsing of AST_TYPE_UNION (union type) nodes for PHP 8.0.0-dev.
  • Reduce memory usage after the polyfill/fallback parser parses ASTs
    (when the final AST isn't cached on disk from a previous run)
  • Make the error message for missing php-ast contain more detailed instructions on how to install php-ast.

Don't miss a new phan release

NewReleases is sending notifications on new releases.