Extbase Annotation injection currently not supported with system-wide symfony dependency injection
/** * @TYPO3\CMS\Extbase\Annotation\Inject * @var \Vendor\Extbase\Services\Service */ public $service;
This will no longer work when the class using this annotation is included under services resource in the Services.yaml of the extension because no support was integrated.
Annotation injection in extbase is currently deprecated for non-public properties. See:
However it is still supported and a decision should be made if this should be supported or/and deprecated entirely.
#2 Updated by Benjamin Franzke 6 months ago
- Status changed from New to Rejected
thanks for bringing that up.
Actually I thought property injection was already deprecated in Extbase when I add support for Symfony DI.
Alexander Schnitzler later told me that only @inject was deprecated, @TYPO3\CMS\Extbase\Annotation\Inject was still supported.
I discussed this topic with Alexander Schnitzler an we agreed that we will not add support for property injection via annotation for symfony DI.
(Note: it could theoretically be configured via Services.yaml, but it's better to migrate to constructor/setter injection)
Furthermore, as we don't have added it until TYPO3 v10 LTS, its now too late anyway.