[TASK] Deprecate parameter type resolving via doc blocks
authorAlexander Schnitzler <git@alexanderschnitzler.de>
Tue, 15 Jan 2019 17:07:56 +0000 (18:07 +0100)
committerBenni Mack <benni@typo3.org>
Mon, 14 Jun 2021 18:12:52 +0000 (20:12 +0200)
commit82fe6c57d509039d3aade8ddbb76c6cf3af90242
treec5e17fee28683629231ae06b54617fe4298ced02
parented6e0d396eaa17e877ab6b4b15d4e07ff79676ee
[TASK] Deprecate parameter type resolving via doc blocks

When a ClassSchema is created for a class, all methods inside said
class are analyzed along with their parameters. Ever since extbase
existed, the parameter type has been read from the doc block.

```
/**
 * @param \Foo\Bar\Baz $baz
 */
public function injectBaz($baz);
```

Since the whole reflection api and PHP itself have been improved
in the recent past, parameter types can be detected without looking
at doc blocks. It is recommended to use native type hints as follows:

```
public function injectBaz(\Foo\Bar\Baz $baz);
```

The doc block is neiter needed nor supported in the near future.
Of course, developers may add a doc block but TYPO3 will no longer
evaluate that as of version 12.0.

Releases: master
Resolves: #94115
Change-Id: Ifc68c0cb8a42b8ab589043afbaebf5dd5763eee5
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/59450
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch <bo@cedev.de>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Documentation/Changelog/master/Deprecation-94115-ParameterTypeEvaluationViaDocBlockComments.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Reflection/ClassSchema.php
typo3/sysext/extbase/Tests/Unit/Reflection/ClassSchemaTest.php
typo3/sysext/extbase/Tests/Unit/Reflection/Fixture/DummyController.php