phan v3.0.1 Release Notes
Release Date: 2020-06-05 // almost 4 years ago-
๐ 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.
- ๐ Support analysis of php 8.0's