Skip to content
Snippets Groups Projects
Commit 64c8a784 authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Benjamin Franzke
Browse files

[TASK] Deprecate @Extbase\Inject

Since core dependency injection is in place and is about to
replace the extbase dependency injection, marking properties
with the @Extbase\Inject annotation to invoke property injection is
deprecated and must be replaced by one of the following di
methods:

- constructor injection: works both with core and extbase di
  and is well suited to make extensions compatible for multiple
  TYPO3 versions.

- setter injection: Basically the same like constructor injection.
  Both the core and extbase di can handle setter injection and
  both are supported in different TYPO3 versions.

- (core) property injection: This kind of injection can be used
  but it requires the configuration of services via a Services.yaml
  in the Configuration folder of an extension.

The recommended way is constructor injection. Not only is it the
most compatible version of di, it also brings the advantage of
clearly showing dependencies of a class. Also, it quickly shows
if dependencies stack up which indicates that the service should
be refactored.

Releases: master
Resolves: #92386
Change-Id: I61afbb6bb15b136c200849c6c8f2cd6211d4c306
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65835


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: default avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: default avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: default avatarBenjamin Franzke <bfr@qbus.de>
parent 154aacdd
Branches
Tags
No related merge requests found
Showing
with 317 additions and 75 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment