Review 12.4 Merged

88081[BUGFIX] Prevent type error in Extension Scanner

Garvin Hicking CR +2 V +2 Easy +18 −1 updated 02/07/25, 15:40

Commit message

Several extension scanner matchers scan a
MethodCall node type, but cannot deal with possible
method concatenation.

Concatenating method names may involve dynamic
variable resolving, which static analysis cannot
perform. Thus, it is a setup for failure to
try this.

Instead this patch gracefully ignores these method
calls to not throw a PHP type error on scanning
extensions.

Teachable moment: Try to not use dynamic method
calls like

```
$dynamic = '1';
$this->{'like' . $dynamic}($arg1, $arg2, $arg3);
```

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 1

Files 6

Review log 57

  1. Garvin Hicking commented on patch set 1 02/07/25, 13:36

    Cherry Picked from branch main. The following files contain Git conflicts: * typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodCallArgumentValueMatcher.php
  2. core-ci voted on patch set 1 V -1 02/07/25, 13:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73729

  3. Garvin Hicking commented on patch set 2 V -1 02/07/25, 13:45

    Published edit on patch set 1.
  4. Garvin Hicking marked it ready for review 02/07/25, 13:45

  5. core-ci voted on patch set 2 V +1 02/07/25, 13:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73733

  6. Garvin Hicking voted on patch set 2 CR +2 V +2 02/07/25, 15:40

  7. Garvin Hicking merged patch set 3 02/07/25, 15:40