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

  • Instead of printing the full help when Phan CLI args or configuration is invalid,
    print just the errors/warnings and instructions and Type ./phan --help (or --extended-help) for usage.
  • Add an option --debug-signal-handler that can be used to diagnose
    why Phan or a plugin is slow or hanging. (Requires the pcntl module)
    This installs a signal handler that response to SIGINT (aka Ctrl-C), SIGUSR1, and SIGUSR2.
  • Print a single backtrace in the crash reporter with the file, line, and arguments instead of multiple backtraces.
  • Emit a warning suggesting using --long-option instead when -long-option[=value] is passed in.
  • Change colorization of some error messages. Print some warnings to stderr instead of using error_log().

New features(Analysis):

  • Emit PhanTypeMismatchPropertyRealByRef or PhanTypeMismatchPropertyByRef
    when potentially assigning an incompatible type to a php 7.4 typed property
    (or a property with a phpdoc type).

  • Warn about suspicious uses of + or += on array shapes or lists. (#3364)
    These operator will prefer the fields from the left hand side,
    and will merge lists instead of concatenate them.
    New issue types: PhanSuspiciousBinaryAddLists, PhanUselessBinaryAddRight

  • Improvements to inferred types of sort, array_merge, etc. (#3354)

  • Fix bug allowing any array shape type to cast to a list.

  • Warn about unnecessary branches leading to identical return statements in pure functions, methods, and closures (#3383)
    This check is only run on pure methods.

    This requires that UseReturnValuePlugin be enabled and works best when 'plugin_config' => ['infer_pure_methods' => true] is set.

  • Allow list<X> to cast to array{0:X, 1?:X} (#3390)

  • Speed up computing line numbers of diagnostics in the polyfill/fallback parser when there are multiple diagnostics.

Language Server/Daemon mode:

  • Reduce the CPU usage of the language server's main process when the pcntl module is used to fork analysis processes (Unix/Linux).
  • Speed up serializing large responses in language server mode (e.g. when a string has an unmatched quote).

Don't miss a new phan release

NewReleases is sending notifications on new releases.