phan v3.2.3 Release Notes

Release Date: 2020-10-12 // over 3 years ago
  • ๐Ÿš€ The Phan 3.x release line uses php-ast's AST version 70 and supports the analysis of all PHP 8.0 syntax except attributes (when run with PHP 8).
    ๐Ÿš€ The planned 4.x release line will use AST version 80 and require php-ast 1.0.10+ in order to parse/analyze PHP 8.0's #[] attributes

    ๐Ÿ†• New features (CLI, Config):

    • Add light_high_contrast support for --color-scheme. (#4203)
      ๐Ÿ‘ท This may be useful in terminals or CI web pages that use white backgrounds.

    ๐Ÿ†• New features (Analysis):

    Infer that parent::someMethodReturningStaticType() is a subtype of the current class, not just the parent class. (#4202)

    ๐Ÿ‘Œ Support phpdoc @abstract or @phan-abstract on non-abstract class constants, properties, and methods
    to indicate that the intent is for non-abstract subclasses to override the definition. (#2278, #2285)
    ๐Ÿ†• New issue types: PhanCommentAbstractOnInheritedConstant, PhanCommentAbstractOnInheritedProperty, PhanCommentOverrideOnNonOverrideProperty

    For example, code using static::SOME_CONST or static::$SOME_PROPERTY or $this->someMethod()
    may declare a placeholder @abstract constant/property/method,
    and use this annotation to ensure that all non-abstract subclasses override the constant/property/method
    (if using real abstract methods is not practical for a use case)

    Warn about @override on properties that do not override an ancestor's property definition.
    ๐Ÿ†• New issue type: PhanCommentOverrideOnNonOverrideProperty.
    (Phan already warns for constants and methods)

    ๐Ÿ”Œ Plugins:

    • ๐Ÿ”Œ Emit PhanPluginUseReturnValueGenerator for calling a function returning a generator without using the returned Generator. (#4013)

    ๐Ÿ› Bug fixes:

    • Properly analyze the right hand side for $cond || throw ...; (e.g. emit PhanCompatibleThrowException) (#4199)
    • Don't infer implications of left || right on the right hand expression when the right hand side has no side effects. (#4199)
    • Emit PhanTypeInvalidThrowStatementNonThrowable for thrown expressions that definitely aren't \Throwable
      even when warn_about_undocumented_throw_statements is disabled or the throw expression is in the top level scope. (#4200)
    • Increase the minimum requirements in composer.json to what Phan actually requires. (#4217)