Aug 25 2020, Phan 3.2.0
New features (CLI, Config):
minimum_target_php_versionconfig setting and
--minimum-target-php-versionCLI flag. (#3939) Phan will use this instead of
target_php_versionfor some backwards compatibility checks (i.e. to check that the feature in question is supported by the oldest php version the project supports).
If this is not configured, Phan will attempt to use the composer.json version ranges if they are available.
target_php_version will be used.
Phan will use
target_php_version instead if
minimum_target_php_version is greater than
Update various checks to use
minimum_target_php_version instead of
By default, phan exits with a non-zero exit code if 1 or more unsuppressed issues were reported.
When this CLI flag is set, phan will instead exit with exit code 0 as long as the analysis completed.
+ Include the installed php-ast version and the php version used to run Phan in the output of
phan --version. (#4147)
New features (Analysis):
PhanCompatibleArrowFunctionif using arrow functions with a minimum target php version older than php 7.4.
PhanCompatibleMatchExpressionif using match expressions with a minimum target php version older than php 8.0.
@(@expr). This is less efficient and only makes a difference in extremely rare edge cases.
?->) for property reads and method calls. (#4067)
@paramshould be used (#1366)
defined()conditions. (#3337) Phan will infer a broad range of types for these constants that can't be narrowed.
non-empty-lowercase-stringin phpdoc for compatibility, but treat them like ordinary strings.
PhanCompatibleTrailingCommaArgumentListwhen the polyfill is used. (#2269) Trailing commas in argument lists require a minimum target version of php 7.3+, and trailing commas in parameters or closure use lists require php 8.0+.
This is only available in the polyfill because the native
exposes the information that php itself tracks internally,
and php deliberately does not track whether any of these node types have trailing commas.
There are already other ways to detect these backwards compatibility issues,
+ Warn about variable definitions that are unused due to fallthroughs in switch statements. (#4162)
PhanStaticCallToNonStaticfrom normal to critical. Undeclared constants will become a thrown
Errorat runtime in PHP 8.0+.
PhanParamNameIndicatingUnusedin files loaded from
\on Windows in
Please login to add feedback.