Review main Merged

92020[BUGFIX] Fix Extension Scanner crash on dynamic method calls

Sebastian Mendel CR +2 V +2 Hard +305 −9 updated 06/11/26, 17:06

Commit message

Several matchers in the Extension Scanner crash when encountering
dynamic method calls like `$object->$methodName()`. This happens
because the code assumes `$node->name` is always an identifier with
a 'name' property, but for dynamic calls it can be a variable.

This is fixed by adding an explicit type check using
an `instanceof` check before accessing `$node->name->name`.
This follows the pattern already used correctly
in `MethodArgumentUnusedMatcher`.

Added tests fixate this behavior.

Affected matchers:
- MethodArgumentDroppedMatcher
- MethodArgumentDroppedStaticMatcher
- MethodArgumentRequiredMatcher
- MethodArgumentRequiredStaticMatcher
- MethodArgumentUnusedMatcher
- MethodCallMatcher
- MethodCallStaticMatcher
- InterfaceMethodChangedMatcher
- PropertyExistsStaticMatcher

Review

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

Issues 1

Files 18

Review log 2640

Show 1015 earlier messages
  1. Sebastian Mendel uploaded patch set 1 12/06/25, 00:45

  2. Sebastian Mendel uploaded patch set 2 12/06/25, 00:48

  3. core-ci voted on patch set 1 V +1 12/06/25, 00:56 Copied votes on follow-up patch sets have been updated: * Verified+1 has been copied to patch set 2 (copy condition: "changekind:NO_CHANGE"). Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91693

  4. core-ci voted on patch set 2 V +1 12/06/25, 01:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91696

  5. Garvin Hicking updated the commit message in patch set 3 V +1 12/06/25, 04:39

  6. Garvin Hicking commented on patch set 3 12/06/25, 04:43

    Good catch! Could you please add a test case / fixture for this scenario that fails wothout the patch and succeeds with these changes in place? That way we can prevent future regressions and fixate this behavior. Thanks!
  7. core-ci voted on patch set 3 V +1 12/06/25, 04:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91713

  8. Sebastian Mendel uploaded patch set 4 V +1 12/06/25, 08:52

  9. Sebastian Mendel commented on patch set 4 12/06/25, 08:56

    Reply

    Done
    Added tests
  10. core-ci voted on patch set 4 V +1 12/06/25, 09:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91725

  11. Sebastian Mendel uploaded patch set 5 V +1 12/06/25, 09:03

  12. core-ci voted on patch set 5 V +1 12/06/25, 09:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91726

  13. Garvin Hicking updated the commit message in patch set 6 V +1 12/06/25, 11:18

  14. Garvin Hicking commented on patch set 6 12/06/25, 11:19

    i've re-edited the commit message to add "Resolves" line and some code markup Lgtm, will check later
  15. Garvin Hicking commented on patch set 6 12/06/25, 11:26

    Could you add ine test that uses the exact $var() call as in the issue? Effectively similar like your current calls, but a parser might still be variant in this and we should cover it at least once.
  1. core-ci voted on patch set 6 V +1 12/06/25, 11:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91728

  2. Sebastian Mendel uploaded patch set 7 V +1 12/06/25, 13:31

  3. Sebastian Mendel commented on patch set 7 12/06/25, 13:35

    Reply

    Done

    Reply

    "Resolves: #108413" line was already there Do you mean "Releases: main, 14.0, 13.4"-line? is this something expected to be set by the patch provider? The patch is already provided for a specific branch, isn't it?
  4. Sebastian Mendel updated the commit message in patch set 8 12/06/25, 13:36

  5. Sebastian Mendel updated the commit message in patch set 9 12/06/25, 13:38

  6. core-ci voted on patch set 7 V +1 12/06/25, 13:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91745

  7. core-ci voted on patch set 8 V +1 12/06/25, 13:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91746

  8. core-ci voted on patch set 9 V +1 12/06/25, 13:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91747

  9. Garvin Hicking commented on patch set 9 12/06/25, 14:05

    Reply

    True I mixed it up. Am only mobile. The line is important to vote on the patch becaue it could not be merged without. The bug would qualify for a 13.4 backport, and I'm trying to keep it in sync with 14.0 too.
  10. Garvin Hicking commented on patch set 9 12/07/25, 19:57

    Can you please check why these three tests do not actually fail without the patch to their matchers: typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodArgumentDroppedStaticMatcherTest.php typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodArgumentRequiredStaticMatcherTest.php typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/MethodCallStaticMatcherTest.php (the others properly report failures)
  11. Netresearch DTT GmbH uploaded patch set 10 V +1 12/08/25, 11:24

  12. Netresearch DTT GmbH uploaded patch set 11 12/08/25, 11:32

  13. core-ci voted on patch set 10 V +1 12/08/25, 11:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91820

  14. core-ci voted on patch set 11 V +1 12/08/25, 11:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91821

  15. Christian Kuhn updated the commit message in patch set 12 V +1 12/08/25, 18:27

  16. core-ci voted on patch set 12 V +1 12/08/25, 18:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91830

  17. Benni Mack updated the commit message in patch set 13 V +1 04/22/26, 06:38

  18. Oliver Klee voted on patch set 13 CR +1 04/22/26, 07:43

  19. core-ci voted on patch set 13 V -1 04/22/26, 07:50 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100746

  20. Christian Kuhn rebased onto patch set 14 CR +1 V -1 06/11/26, 15:27

  21. Christian Kuhn commented on patch set 14 CR +1 V +1 06/11/26, 15:28

    Reply

    Done
    mmh. this is fine, right? let's get it done?!
  22. Oliver Klee voted on patch set 14 CR +1 V +1 06/11/26, 15:32

  23. core-ci voted on patch set 14 V +1 06/11/26, 15:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/103410

  24. Garvin Hicking commented on patch set 14 CR +2 V +2 06/11/26, 16:12

    I think so, can't remember details. Lgtm.
  25. Garvin Hicking merged patch set 15 06/11/26, 17:06