Aug 01 2021, Phan 5.0.0
New Features (Analysis):
function(A&B $paramName = null)) being a compile error.
New issue type: PhanTypeMismatchDefaultIntersectionPhanTypeMismatchArgumentSuperType instead of PhanTypeMismatchArgument when passing in an object supertype (e.g. ancestor class) of an object instead of a subtype.
Emit PhanTypeMismatchReturnSuperType instead of PhanTypeMismatchReturn when returning an object supertype (e.g. ancestor class) of an object instead of a subtype.Phan 5 starts warning about ancestor classes being incompatible argument or return types in cases where it previously allowed it. (#4413)
Jul 24 2021, Phan 5.0.0a4
New Features (Analysis):
PhanSyntaxEnumCaseExpectedValue, PhanSyntaxEnumCaseUnexpectedValue, PhanTypeUnexpectedEnumCaseTypeBackwards incompatible changes:
Maintenance:
Bug fixes:
ReturnTypeWillChangeJul 15 2021, Phan 5.0.0a3
New Features (Analysis):
new expressions in php 8.1 readonly property modifier (#4460)PhanTypeInvalidArrayKey and PhanTypeInvalidArrayKeyValue for invalid array key literal types or values.PhanTypeMissingReturn/PhanPluginAlwaysReturnMethod for method with phpdoc return type of @return neverStringable to allowed types for sprintf variadic arguments. This currently requires explicitly implementing Stringable. (#4466)Bug fixes:
Jun 26 2021, Phan 5.0.0a2
New Features (Analysis):
<=PhanAccessOverridesFinalConstant when overriding a final class constant. (#4436)PhanCompatibleFinalClassConstant if class constants have the final modifier in codebases supporting a minimum target php version older than 8.1 (#4436)New Features (CLI)
var_representation/polyfill for generating representations of values in issue messages.Maintenance:
Bug fixes:
static fn declared in an instance method. (#4336)May 30 2021, Phan 5.0.0a1
Phan 5 introduces support for intersection types, and improves the accuracy of type casting checks and type inference to catch more issues.
This is the unstable branch for alpha releases of Phan 5. Planned/remaining work is described in https://github.com/phan/phan/issues/4413
If you are migrating from Phan 4, it may be useful to set up or update a Phan baseline file to catch issues such as nullable type mismatches.
https://github.com/phan/phan/wiki/Tutorial-for-Analyzing-a-Large-Sloppy-Code-Base has other advice on setting up suppressions.
For example, Phan is now more consistently warning about nullable arguments (i.e. both \X|null and ?\X) in a few cases where it may have not warned about passing \X|null to a function that expects a non-null type.
If you are using plugins that are not part of Phan itself, they may have issues in Phan 5 due to additional required methods being added to many of Phan's methods.
New Features (Analysis):
instanceofPhanImpossibleIntersectionTypePhanPossiblyUndeclaredPropertyOfClassPhanPossiblyUndeclaredProperty*)@template-covariant T as an alias of @template T - Previously, that tag was not parsed and T would be treated like a (probably undeclared) classlike name. (#4432)Bug fixes:
Breaking Changes:
CodeBase instance. This will affect third party plugins.--language-server-min-diagnostic-delay-ms.Updates may require up to 24 hours to propagate to mirrors. If the following command doesn't work, please retry later:
sudo dnf upgrade --refresh --advisory=FEDORA-2021-ab49083dc8
Please login to add feedback.
This update has been submitted for testing by remi.
This update's test gating status has been changed to 'ignored'.
This update's test gating status has been changed to 'waiting'.
This update's test gating status has been changed to 'ignored'.
This update has been pushed to testing.
This update has been submitted for stable by bodhi.
This update has been pushed to stable.