Project

General

Profile

Actions

Bug #88904

closed

Extbase Annotation injection currently not supported with system-wide symfony dependency injection

Added by Daniel Goerz over 5 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Should have
Category:
System/Bootstrap/Configuration
Target version:
-
Start date:
2019-08-03
Due date:
% Done:

0%

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

Description

/**
 * @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:

https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.0/Deprecation-82975-DeprecateUsageOfInjectWithNonPublicProperties.html

https://docs.typo3.org/c/typo3/cms-core/master/en-us/Changelog/9.5.x/Deprecation-86907-DeprecateUsageOfDependencyInjectionWithNonPublicProperties.html

However it is still supported and a decision should be made if this should be supported or/and deprecated entirely.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #88689: Support for system-wide class dependency injection, PSR-11Closed2019-07-05

Actions
Actions #1

Updated by Daniel Goerz over 5 years ago

  • Related to Feature #88689: Support for system-wide class dependency injection, PSR-11 added
Actions #2

Updated by Benjamin Franzke over 4 years ago

  • Status changed from New to Rejected

Hey,

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.

Best Regards,
Benjamin

Actions

Also available in: Atom PDF