Review main Merged

63676[BUGFIX] Handle constructor arguments in extension scanner correctly

Oliver Hader CR +2 V +2 Hard +524 −56 updated 03/11/20, 12:46

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

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 1

Files 12