Bug #90722

Handle constructor arguments in extension scanner correctly

Added by Oliver Hader over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2020-03-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Handling constructor arguments in extension scanner did not work since constructors are not directly called like a method would be called. Constructors are invoked instead using the new statement. Besides that GeneratorClassResolver only supported string class names (e.g. 'Example\\MyClass') when being invoked via GeneralUtility::makeInstance.

Scanner configurations related to __construct invocation in terms of creating a new class instance are now handled in their own ConstructorArgumentMatcher. Besides that, GeneratorClassResolver supports GeneralUtility::makeInstance(Example\MyClass::class, 123) as well.


Files

scanner.png (91.5 KB) scanner.png Oliver Hader, 2020-03-10 20:57

Related issues

Related to TYPO3 Core - Bug #91128: PHP Catchable Fatal Error: Object of class PhpParser\Node\Expr\PropertyFetch could not be converted to stringClosed2020-04-19

Actions
Related to TYPO3 Core - Bug #91866: extensionScannerRstFileReferences check throws warningsClosedAnja Leichsenring2020-07-25

Actions
#1

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63676

#2

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63676

#3

Updated by Oliver Hader over 1 year ago

Having the patch applied, it should look similar to the following for new and GeneralUtility::makeInstance...

#4

Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63676

#5

Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63676

#6

Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63683

#7

Updated by Oliver Hader over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#8

Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed
#9

Updated by Christian Eßl about 1 year ago

  • Related to Bug #91128: PHP Catchable Fatal Error: Object of class PhpParser\Node\Expr\PropertyFetch could not be converted to string added
#10

Updated by Anja Leichsenring 11 months ago

  • Related to Bug #91866: extensionScannerRstFileReferences check throws warnings added

Also available in: Atom PDF