Review 14.3 Merged

95387[TASK] Exclude IDE class alias stubs from PHPStan

Stefan Bürk CR +2 V +2 Easy +4 −0 updated 08/23/26, 14:48

Commit message

PHPStan 2.2.9 reports the deprecated alias Extbase Annotation
Validate as not being an attribute class, which turns the nightly
phpstan max job red without any Core change involved.

The rule itself did not change. Up to 2.2.8 the autoload functions
source locator was consulted first, so the name resolved through
typo3/class-alias-loader to the real attribute class. Since 2.2.9
custom autoloaders are consulted after the static locators, and the
composer loader detection fails because class-alias-loader replaces
it. The directory locator therefore wins and returns the IDE stub,
which declares the alias as a plain subclass. PHP does not inherit
the attribute marker to subclasses, hence the report.

Reported upstream, since it affects any project replacing the
composer class loader:
https://github.com/phpstan/phpstan/issues/15102

The stub files are guarded by die() and are never loaded at runtime,
they exist only for IDE indexing and static analysis. Excluding them
lets PHPStan resolve the names through the class alias loader again,
which matches the runtime situation, and stays worthwhile no matter
how the upstream report is resolved.

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Garvin Hicking +1
  • Verified V +2 Done
    • Stefan Bürk +2
    • Georg Ringer +1
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 68

  1. Stefan Bürk uploaded patch set 1 08/23/26, 13:51

  2. core-ci voted on patch set 1 V +1 08/23/26, 13:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106989

  3. Stefan Bürk updated the commit message in patch set 2 V +1 08/23/26, 14:36

  4. core-ci voted on patch set 2 V +1 08/23/26, 14:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/106993

  5. Georg Ringer voted on patch set 2 CR +1 V +1 08/23/26, 14:47

  6. Garvin Hicking voted on patch set 2 CR +1 V +1 08/23/26, 14:48

  7. Stefan Bürk voted on patch set 2 CR +2 V +2 08/23/26, 14:48

  8. Stefan Bürk merged patch set 3 08/23/26, 14:48