The Phan 2.x releases support analysis of php 7.0-7.3, and can be executed with php 7.1+.
New features(CLI, Configs):
- Enable language server features by default. (#2358)
--language-server-disable-go-to-definition
,--language-server-disable-hover
, and--language-server-disable-completion
can be used to disable those features.
Backwards Incompatible Changes:
- Drop support for running Phan with PHP 7.0. (PHP 7.0 reached its end of life in December 2018)
Analyzing codebases with--target-php-version 7.0
continues to be supported. - Require php-ast 1.0.1 or newer (or the absence of php-ast with
--allow-polyfill-parser
)
Phan switched from using AST version 50 to version 70.
Plugins:
-
Change
PluginV2
toPluginV3
PluginV2
and its capabilities will continue to work to make migrating to Phan 2.x easier, butPluginV2
is deprecated and will be removed in Phan 3.PluginV3
has the same APIs and capabilities as PluginV2, but uses PHP 7.1 signatures (void
,?MyClass
, etc.) -
Third party plugins may need to be upgraded to support changes in AST version 70, e.g. the new node kinds
AST_PROP_GROUP
andAST_CLASS_NAME
-
Add
PHPDocToRealTypesPlugin
to suggest real types to replace (or use alongside) phpdoc return types.
This does not check that the phpdoc types are correct.--automatic-fix
can be used to automate making these changes for issues that are not suppressed. -
Add
PHPDocRedundantPlugin
to detect functions/methods/closures where the doc comment just repeats the types in the signature.
(or when other parts don't just repeat information, but the@return void
at the end is redundant) -
Add a
BeforeAnalyzePhaseCapability
. UnlikeBeforeAnalyzeCapability
, this will run after methods are analyzed, not before.