Review 9.5 Merged

63683[BUGFIX] Handle constructor arguments in extension scanner correctly

Oliver Hader CR +2 V +2 Hard +512 −46 updated 03/11/20, 19:16

Commit message

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 (like
`'Example\\MyClass'`) when being invoked using
`GeneralUtility::makeInstance`.

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

`NameResolver` and `GeneratorClassesResolver` are executed in two
consecutive `NodeTraverser` instances - otherwise class names cannot
be resolved in a reliable way.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
  • Verified V +2 Done
    • Oliver Hader +2
    • TYPO3com +1 CI

Issues 1

Files 11

Review log 34

  1. Oliver Hader uploaded patch set 1 03/11/20, 12:46

  2. TYPO3com voted on patch set 1 V +1 03/11/20, 12:59 Completed build in 12m 50s on Wed, 11 Mar, 12:59 PM Test Summary: 74544 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-209

  3. Oliver Hader voted on patch set 1 V +2 CR +2 03/11/20, 19:15

  4. Oliver Hader merged patch set 2 03/11/20, 19:16