New features(Analysis):
- Support analysis of php 8.0's
mixed
type (#3899)
New issue types:PhanCompatibleMixedType
,PhanCompatibleUseMixed
. - Treat
static
andfalse
like real types and emit more severe issues in all php versions. - Improve type inferences from negated type assertions (#3923)
(analyze more expression kinds, infer real types in more places) - Warn about unnecessary use of
expr ?? null
. (#3925)
New issue types:PhanCoalescingNeverUndefined
. - Support PHP 8.0 non-capturing catches (#3907)
New issue types:PhanCompatibleNonCapturingCatch
. - Infer type of
$x->magicProp
from the signature of__get
- Treat functions/methods that are only called by themselves as unreferenced during dead code detection.
- Warn about
each()
being deprecated when thetarget_php_version
is php 7.2+. (#2746)
This is special cased because PHP does not flag the function itself as deprecated inReflectionFunction
.
(PHP only emits the deprecation notice foreach()
once at runtime)
Miscellaneous:
- Check for keys that are too long when computing levenshtein distances (when Phan suggests alternatives).
Plugins:
- Add
AnalyzeLiteralStatementCapability
for plugins to analyze no-op string literals (#3911) - In
PregRegexCheckerPlugin
, warn if$
allows an optional newline before the end of the string
when configuration includes['plugin_config' => ['regex_warn_if_newline_allowed_at_end' => true]]
) (#3915) - In
SuspiciousParamOrderPlugin
, warn if an argument has a near-exact name match for a parameter at a different position (#3929)
E.g. warn about callingfoo($b)
orfoo(true, $this->A)
forfunction foo($a = false, $b = false)
.
New issue types:PhanPluginSuspiciousParamPosition
,PhanPluginSuspiciousParamPositionInternal
Bug fixes:
- Fix false positive
PhanTypeMismatchPropertyDefault
involving php 7.4 typed properties with no default
and generic comments (#3917) - Don't remove leading directory separator when attempting to convert a file outside the project to a relative path.