Issue Bug Closed

#108413[BUGFIX] Extension Scanner matchers crash on dynamic method calls

Sebastian Mendel 12/06/25, 00:22 updated 08/11/26, 08:46

Description

Problem

The Extension Scanner in the Install Tool crashes with a TypeError when scanning extensions that contain dynamic method calls like `$this->$methodName()` or `$object->$variable()`.

Environment

  • TYPO3 Version: 14.1-dev (main branch)
  • PHP Version: 8.2+

Affected Files

9 matcher classes are affected:
  • MethodArgumentDroppedMatcher
  • MethodArgumentDroppedStaticMatcher
  • MethodArgumentRequiredMatcher
  • MethodArgumentRequiredStaticMatcher
  • MethodArgumentUnusedMatcher
  • MethodCallMatcher
  • MethodCallStaticMatcher
  • InterfaceMethodChangedMatcher
  • PropertyExistsStaticMatcher

Root Cause

The matchers assume `$node->name` is always a `PhpParser\Node\Identifier` and access `$node->name->name` directly. When the method name is a variable (dynamic call), `$node->name` is a
`PhpParser\Node\Expr\Variable`, which has no `name` property.

Solution

Add an explicit type check using `$node->name instanceof Identifier` before accessing `$node->name->name`. This safely skips dynamic method calls that cannot be matched against deprecation patterns
anyway.

Impact

Without this fix, extensions using dynamic method calls cannot be scanned, preventing developers from identifying actual deprecations in their code.

Reviews 2