Review 14.3 Merged

97194[TASK] Improve extension scanner

Oli Bartsch CR +2 V +2 Hard +431 −259 updated 10/28/26, 15:51

Commit message

Rework the PHP extension scanner of EXT:install:

- CodeScannerInterface now extends PhpParser\NodeVisitor, so every
  matcher is a parser visitor by contract and MatcherFactory only
  needs one instance check instead of two
- Move the pure node visitors CodeStatistics and
  GeneratorClassesResolver to the new namespace
  ExtensionScanner\Php\Visitor
- Add native property/parameter/return types and precise PHPDoc array
  shapes to the matchers, and use the typed node accessors
  (getStartLine(), getComments(), ->name) instead of generic
  attribute access
- Check for an ignored file before inspecting the node, so
  @extensionScannerIgnoreFile now also takes effect in
  MethodAnnotationMatcher and PropertyAnnotationMatcher
- Replace isset() chains on call arguments with explicit Arg and
  scalar node checks via getRawArgs(), and make the $this receiver
  check in PropertyProtectedMatcher explicit; both keep the existing
  behaviour and are covered by additional fixture lines
- Ignore class constant fetches with an expression name like
  Foo::{$bar} in ClassConstantMatcher: building the lookup key from
  them threw an object-to-string error and aborted the scan
- Use early returns in matcher conditions and improve a few
  error messages

All improvements come from the standalone Extension Scanner and raising
the Phpstan level to 8. The standalone Extension Scanner is now almost
in sync with the TYPO3 Core.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
  • Verified V +2 Done
    • Oli Bartsch +2
    • core-ci +1 CI

Issues 1

Files 44

Show 24 more files

Review log 34

  1. Oli Bartsch uploaded patch set 1 10/28/26, 13:28

  2. core-ci voted on patch set 1 V +1 10/28/26, 13:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112711

  3. Oli Bartsch voted on patch set 1 CR +2 V +2 10/28/26, 15:51

  4. Oli Bartsch merged patch set 2 10/28/26, 15:51