[BUGFIX] Prevent type error in Extension Scanner
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); ``` Resolves: #106043 Releases: main, 13.4, 12.4 Change-Id: I20a2953d649ea7377492eed489965f617b1069ae Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88046 Tested-by:core-ci <typo3@b13.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Garvin Hicking <gh@faktor-e.de>
Showing
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/InterfaceMethodChangedMatcher.php 1 addition, 1 deletion...sionScanner/Php/Matcher/InterfaceMethodChangedMatcher.php
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentDroppedMatcher.php 1 addition, 0 deletions...nsionScanner/Php/Matcher/MethodArgumentDroppedMatcher.php
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentRequiredMatcher.php 1 addition, 0 deletions...sionScanner/Php/Matcher/MethodArgumentRequiredMatcher.php
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodArgumentUnusedMatcher.php 1 addition, 0 deletions...ensionScanner/Php/Matcher/MethodArgumentUnusedMatcher.php
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodCallArgumentValueMatcher.php 1 addition, 0 deletions...ionScanner/Php/Matcher/MethodCallArgumentValueMatcher.php
- typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/MethodCallMatcher.php 1 addition, 0 deletions...lasses/ExtensionScanner/Php/Matcher/MethodCallMatcher.php
- typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/InterfaceMethodChangedMatcherFixture.php 13 additions, 0 deletions...Matcher/Fixtures/InterfaceMethodChangedMatcherFixture.php
Please register or sign in to comment