phan v2.7.0 Release Notes

Release Date: 2020-04-01 // 6 days ago
  • 🆕 New features(CLI, Configs):

    • Sort output of --dump-ctags=basic by element type before sorting by file name (#3811)
      (e.g. make class and global function declarations the first tag type for a tag name)
    • 0️⃣ Colorize the output of phan_client by default for the default and text output modes. (#3808)
      ➕ Add phan --no-color option to disable colors.
    • Warn about invalid CLI flags in phan_client (#3776)
    • 👌 Support representing more AST node types in issue messages. (#3783)
    • 👉 Make some issue messages easier to read (#3745, #3636)
    • 👍 Allow using --minimum-severity=critical instead of --minimum-severity=10 (#3715)
    • 0️⃣ Use better placeholders for parameter default types than null in issue messages and hover text (#3736)
    • 🚀 Release phantasm, a prototype tool for assembling information about a codebase and aggressively optimizing it.
      Currently, the only feature is replacing class constants with their values, when safe to do so.
      ⚡️ More features (e.g. inlining methods, aggressively optimizing out getters/setters, etc.) are planned for the future.
      👀 See tool/phantasm --help for usage.

    🆕 New features(Analysis):

    • 👌 Improve analysis of php 7.4 typed properties.
      👌 Support extracting their real union types from Reflection information.
      0️⃣ Infer the existence of properties that are not in ReflectionClass->getPropertyDefaults()
      0️⃣ due to being uninitialized by default.
    • Emit PhanAbstractStaticMethodCall* when calling an abstract static method statically. (#3799)
    • Emit PhanUndeclaredClassReference instead of PhanUndeclaredClassConstant for MissingClass::class.

    Language Server/Daemon mode:

    • 👀 Catch exception seen when printing debug info about not being able to parse a file.
    • Warn when Phan's language server dependencies were installed for php 7.2+
      but the language server gets run in php 7.1. (phpdocumentor/reflection-docblock 5.0 requires php 7.2)
    • Immediately return cached hover text when the client repeats an identical hover request. (#3252)

    Miscellaneous:

    • 🛠 PHP 8.0-dev compatibility fixes, analysis for some new functions of PHP 8.0-dev.
    • ➕ Add symfony/polyfill-php72 dependency so that symfony 5 will work better in php 7.1.
      🚀 The next Phan major release will drop support for php 7.1.

Previous changes from v2.6.1

  • 🆕 New features(CLI, Configs):

    • ➕ Add a --dump-ctags=basic flag to dump a tags file in the project root directory. (https://linux.die.net/man/1/ctags)
      This is different from tool/make_ctags_for_phan_project - --dump-ctags=basic has no external dependencies.

    🆕 New features(Analysis):

    • Infer that the real type set of the key in foreach ($arrayVar as $key => ...) is definitely an int|string
      in places where Phan previously inferred the empty union type, improving redundant condition detection. (#3789)

    🐛 Bug fixes:

    • 🛠 Fix a crash in phan --dead-code-detection when a trait defines a real method and phpdoc @method of the same name (#3796)

    Miscellaneous:

    • Also allow netresearch/jsonmapper@^2.0 as a dependency when enforcing the minimum allowed version (#3801)