diff --git a/typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcher.php b/typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcher.php index 356ce2251bb27b48e433d2015763745afe018830..39cd3b91f4bfd73e0351ff0d9b4196f499e83e36 100644 --- a/typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcher.php +++ b/typo3/sysext/install/Classes/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcher.php @@ -69,6 +69,8 @@ class ConstructorArgumentMatcher extends AbstractCoreMatcher } $resolvedNode = $node->getAttribute(self::NODE_RESOLVED_AS, null) ?? $node; if (!$resolvedNode instanceof New_ + || !isset($resolvedNode->class) + || is_object($node->class) && !method_exists($node->class, '__toString') || !array_key_exists((string)$resolvedNode->class, $this->matcherDefinitions) ) { return; diff --git a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcherTest.php b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcherTest.php index 31c44a79cbc14a6a2192decb568290d911bdc972..2835c20add905e795711122119d236f22ea21c7e 100644 --- a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcherTest.php +++ b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/ConstructorArgumentMatcherTest.php @@ -45,7 +45,7 @@ class ConstructorArgumentMatcherTest extends TestCase 'numberOfMandatoryArguments' => 4, ]), ], - [34, 35, 36, 37, 42, 43], + [34, 35, 36, 37, 44, 45], ], 'dropped' => [ [ @@ -53,7 +53,7 @@ class ConstructorArgumentMatcherTest extends TestCase 'maximumNumberOfArguments' => 2, ]), ], - [34, 35, 36, 37, 42, 43], + [34, 35, 36, 37, 44, 45], ], 'called' => [ [ @@ -62,7 +62,7 @@ class ConstructorArgumentMatcherTest extends TestCase 'maximumNumberOfArguments' => 3, ]), ], - [34, 35, 36, 37, 42, 43], + [34, 35, 36, 37, 44, 45], ], 'unused' => [ [ diff --git a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ConstructorArgumentMatcherFixture.php b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ConstructorArgumentMatcherFixture.php index 7e1daa442333289b3b15bad4da625a891393ced6..bed67ba74e03715e87f655a1c0373befc5f1c942 100644 --- a/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ConstructorArgumentMatcherFixture.php +++ b/typo3/sysext/install/Tests/Unit/ExtensionScanner/Php/Matcher/Fixtures/ConstructorArgumentMatcherFixture.php @@ -35,6 +35,8 @@ class ConstructorArgumentMatcherFixture extends Subject $b = new \TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures\Subject('a', 'b', 'c'); $c = GeneralUtility::makeInstance(Subject::class, 'a', 'b', 'c'); $d = GeneralUtility::makeInstance(\TYPO3\CMS\Install\Tests\Unit\ExtensionScanner\Php\Matcher\Fixtures\Subject::class, 'a', 'b', 'c'); + $className = Subject::class; + $e = new $className('a', 'b', 'c'); } public function unused(): void