Skip to content
Snippets Groups Projects
Commit 2c30be8a authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[!!!][TASK] Clean up Context

The constructor of class Context is unfortunate: It
needs to be registered in DI container to be injectable.
If an extension uses GU::makeInstance() with manual
constructor arguments of this class, it could shortcut
the container lookup and would create an own instance
not registered in the container, which could lead to
a second instance when Context is injected. The
constructor is only used in tests, tests are adapted
and constructor removed with the patch.

Also, the two classes ContextAwareInterface and
ContextAwareTrait look as if they are general things
that can be used similar to the PSR-3 LoggerAwareInterface
which is handled directly in DI / makeInstance(), but in
fact it is just a detail of the core routing aspect
handling. In those cases, DI / makeInstance() can be used
directly. We drop both classes to avoid confusion. Note
this also makes AspectFactory stateless.

Resolves: #102645
Releases: main
Change-Id: Ice0d4063bcfc8ff0c267f1b8155eab576d7d6772
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82159


Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
parent 7627fd70
Branches
Tags
No related merge requests found
Showing
with 162 additions and 287 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