stable

phan-5.0.0-1.fc34 and php-microsoft-tolerant-php-parser-0.1.1-1.fc34

FEDORA-2021-ab49083dc8 created by remi 2 years ago for Fedora 34

Aug 01 2021, Phan 5.0.0

New Features (Analysis):

  • Warn about implicitly nullable parameter intersection types (function(A&B $paramName = null)) being a compile error. New issue type: PhanTypeMismatchDefaultIntersection
  • Emit PhanTypeMismatchArgumentSuperType 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):

  • Use the enum class declaration type (int, string, or absent) from AST version 85 to check if enum cases are valid. (#4313) New issue types: PhanSyntaxEnumCaseExpectedValue, PhanSyntaxEnumCaseUnexpectedValue, PhanTypeUnexpectedEnumCaseType

Backwards incompatible changes:

  • Bump the minimum required AST version from 80 to 85 (Required to analyze php 8.1 enum classes - 'type' was added in AST version 85).
  • In php 8.1, require php-ast 1.0.14 to natively parse AST version 85.

Maintenance:

  • Upgrade tolerant-php-parser from 0.1.0 to 0.1.1 to prepare to support new php syntax in the polyfill/fallback parser. (#4449)

Bug fixes:

  • Fix extraction of reflection attribute target type bitmask from internal attributes such as PHP 8.1's ReturnTypeWillChange

Jul 15 2021, Phan 5.0.0a3

New Features (Analysis):

  • Support parsing php 8.1 intersection types in php-ast 1.0.13+ (#4469) (not yet supported in polyfill)
  • Support parsing php 8.1 first-class callable syntax in unreleased php-ast version (#4464)
  • Support parsing php 8.1 readonly property modifier (#4463)
  • Support allowing new expressions in php 8.1 readonly property modifier (#4460)
  • Emit PhanTypeInvalidArrayKey and PhanTypeInvalidArrayKeyValue for invalid array key literal types or values.
  • Fix false positive PhanTypeMissingReturn/PhanPluginAlwaysReturnMethod for method with phpdoc return type of @return never
  • Warn about direct access to static methods or properties on traits (instead of classes using those methods/properties) being deprecated in php 8.1 (#4396)
  • Add Stringable to allowed types for sprintf variadic arguments. This currently requires explicitly implementing Stringable. (#4466)

Bug fixes:

  • Fix a crash when analyzing array literals with invalid key literal values in php 8.1.
  • Fix a crash due to deprecation notices for accessing trait methods/properties directly in php 8.1

Jun 26 2021, Phan 5.0.0a2

New Features (Analysis):

  • Improve accuracy of checks for weak type overlap for redundant condition warnings on <=
  • Emit PhanAccessOverridesFinalConstant when overriding a final class constant. (#4436)
  • Emit PhanCompatibleFinalClassConstant if class constants have the final modifier in codebases supporting a minimum target php version older than 8.1 (#4436)
  • Analyze class constants declared in interfaces as if they were final in php versions prior to 8.1. (#4436)
  • Warn about using $this or superglobals as a parameter or closure use. (#4336)

New Features (CLI)

  • Use var_representation/polyfill for generating representations of values in issue messages.

Maintenance:

  • Upgrade tolerant-php-parser from 0.0.23 to 0.1.0 to prepare to support new php syntax in the polyfill/fallback parser. (#4449)

Bug fixes:

  • Properly warn about referencing $this from a static fn declared in an instance method. (#4336)
  • Fix a crash getting template parameters of intersection types

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):

  • Support parsing intersection types in phpdoc and checking if intersection types satisfy type comparisons
  • Support inferring intersection types from conditions such as instanceof
  • Warn about impossible type combinations in phpdoc intersection types. New issue types: PhanImpossibleIntersectionType
  • Improve type checking precision for whether a type can cast to another type.
  • Improve precision of checking if a type is a subtype of another type.
  • Split out warnings about possibly invalid types for property access (non-object) and possibly invalid classes for property access New issue types: PhanPossiblyUndeclaredPropertyOfClass
  • Also check for partially invalid expressions for instance properties during assignment (PhanPossiblyUndeclaredProperty*)
  • Treat @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:

  • Fix wrong expression in issue message for PhanPossiblyNullTypeMismatchProperty (#4427)

Breaking Changes:

  • Many internal methods now require a mandatory CodeBase instance. This will affect third party plugins.
  • Remove --language-server-min-diagnostic-delay-ms.

How to install

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

This update has been submitted for testing by remi.

2 years ago

This update's test gating status has been changed to 'ignored'.

2 years ago

This update's test gating status has been changed to 'waiting'.

2 years ago

This update's test gating status has been changed to 'ignored'.

2 years ago

This update has been pushed to testing.

2 years ago

This update has been submitted for stable by bodhi.

2 years ago

This update has been pushed to stable.

2 years ago

Please login to add feedback.

Metadata
Type
enhancement
Karma
0
Signed
Content Type
RPM
Test Gating
Settings
Unstable by Karma
-3
Stable by Karma
3
Stable by Time
7 days
Dates
submitted
2 years ago
in testing
2 years ago
in stable
2 years ago

Automated Test Results