phan v3.2.1 Release Notes
Release Date: 2020-09-13 // over 3 years ago-
๐ New features (Analysis):
- Don't compare parameter types against alternate method signatures which have too many required parameters.
(e.g. warn aboutmax([])
but notmax([], [1])
) - Support
/** @unused-param $param_name */
in doc comments as an additional way to support suppressing warnings about individual parameters being unused. - Warn about loop conditions that potentially don't change due to the body of the loop.
This check uses heuristics and is prone to false positives.
๐ New issue types:PhanPossiblyInfiniteLoop
- Treat
unset($x);
as shadowing variable definitions during dead code detection. - ๐ Change the way
$i++
,--$i
, etc. are analyzed during dead code detection - Properly enable
allow_method_param_type_widening
by default when the inferredminimum_target_php_version
is'7.2'
or newer. (#4168) - ๐ Start preparing for switching to AST version 80 in an upcoming Phan 4 release. (#4167)`
๐ Bug fixes:
- ๐ Fix various crashes in edge cases.
- ๐ Fix crash with adjacent named labels for gotos in the polyfill/fallback parser.
- ๐ Fix false positive unused parameter warning with php 8.0 constructor property promotion.
๐ Plugins:
- ๐ Warn about
#
comments inPHPDocInWrongCommentPlugin
if they're not used for the expected#[
syntax of php 8.0 attributes.
๐ง Maintenance:
- โก๏ธ Update polyfill/fallback parser to properly skip attributes in php 8.0.
๐ The upcoming Phan 4 release will support analyzing attributes, which requires AST version 80.
- Don't compare parameter types against alternate method signatures which have too many required parameters.