phan v2.5.0 Release Notes
Release Date: 2020-02-20 // about 4 years ago-
๐ New Features(CLI):
- ๐ Support using
directory_suppressions
in Phan baseline files in--load-baseline
. (#3698) - ๐ Improve error message for warnings about Phan being unable to read files in the analyzed directory.
๐ New Features(Analysis):
๐ Instead of failing to parse intersection types in phpdoc entirely, parse them as if they were union types. (#1629)
The annotations@phan-param
,@phan-return
,@phan-var
, etc. can be used to override the regular phpdoc in the various cases where this behavior causes problems.Future Phan releases will likely about unsupported phpdoc (e.g.
int&string
) and have actual support for intersection types.๐ Emit
PhanUndeclaredConstantOfClass
(severity critical) for undeclared class constants instead ofPhanUndeclaredConstant
(severity normal)
This should not be confused withPhanUndeclaredClassConstant
, which already exists and refers to accessing class constants of classes that don't exist.Emit the expression that's an invalid object with issue types such as
PhanTypeExpectedObject*
,PhanTypeInvalidInstanceof
(#3717)Emit
PhanCompatibleScalarTypePHP56
andPhanCompatibleAnyReturnTypePHP56
for function signatures whentarget_php_version
is'5.6'
(#915)
(This also requires thatbackward_compatibility_checks
be enabled.)โ Use more accurate line numbers for warnings about function parameters.
When
assume_real_types_for_internal_functions
is on and a function has a non-empty return type in Reflection,
๐ make Phan's known real type signatures override the real reflection return type information (useful when Phan inferslist<string>
and Reflection saysarray
).
Phan previously used the type from Reflection.Normalize phpdoc parameter and return types when there is a corresponding real type in the signature. (#3725)
(e.g. convertbool|false|null
to?bool
)๐ Plugins:
- โ Add
SubscribeEmitIssueCapability
to detect or suppress issues immediately before they are emitted. (#3719)
๐ Bug fixes:
- Don't include issues that weren't emitted in the file generated by
--save-baseline
(#3719) - ๐ Fix incorrect file location for other definition in
PhanRedefinedClassReference
under some circumstances. - ๐ Fix incorrect issue name:
PhanCompatibleNullableTypePHP71
should be namedPhanCompatibleObjectTypePHP71
- ๐ Fix false positive
PhanPartialTypeMismatchProperty
when a php 7.4 typed property has a default expression value (#3725)
- ๐ Support using