[!!!][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:Benni Mack <benni@typo3.org> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Simon Schaufelberger <simonschaufi+typo3@gmail.com> Tested-by:
Oliver Klee <typo3-coding@oliverklee.de> Reviewed-by:
Oliver Bartsch <bo@cedev.de> Tested-by:
Simon Schaufelberger <simonschaufi+typo3@gmail.com> Tested-by:
Oliver Bartsch <bo@cedev.de> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Oliver Klee <typo3-coding@oliverklee.de>
Showing
- typo3/sysext/backend/Classes/Authentication/PasswordReset.php 0 additions, 1 deletion...3/sysext/backend/Classes/Authentication/PasswordReset.php
- typo3/sysext/backend/Tests/Functional/Controller/Page/TreeControllerTest.php 1 addition, 6 deletions...d/Tests/Functional/Controller/Page/TreeControllerTest.php
- typo3/sysext/core/Classes/Context/Context.php 0 additions, 12 deletionstypo3/sysext/core/Classes/Context/Context.php
- typo3/sysext/core/Classes/Context/ContextAwareInterface.php 0 additions, 25 deletionstypo3/sysext/core/Classes/Context/ContextAwareInterface.php
- typo3/sysext/core/Classes/Context/ContextAwareTrait.php 0 additions, 36 deletionstypo3/sysext/core/Classes/Context/ContextAwareTrait.php
- typo3/sysext/core/Classes/Database/Query/Restriction/FrontendRestrictionContainer.php 1 addition, 4 deletions...tabase/Query/Restriction/FrontendRestrictionContainer.php
- typo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php 5 additions, 37 deletionstypo3/sysext/core/Classes/Routing/Aspect/AspectFactory.php
- typo3/sysext/core/Classes/Routing/Aspect/PersistedAliasMapper.php 2 additions, 5 deletions...sext/core/Classes/Routing/Aspect/PersistedAliasMapper.php
- typo3/sysext/core/Classes/Routing/Aspect/PersistedPatternMapper.php 3 additions, 6 deletions...xt/core/Classes/Routing/Aspect/PersistedPatternMapper.php
- typo3/sysext/core/Classes/Routing/PageSlugCandidateProvider.php 3 additions, 14 deletions...sysext/core/Classes/Routing/PageSlugCandidateProvider.php
- typo3/sysext/core/Classes/Site/Entity/Site.php 0 additions, 2 deletionstypo3/sysext/core/Classes/Site/Entity/Site.php
- typo3/sysext/core/Documentation/Changelog/13.0/Breaking-102645-MoreStrictContextHandling.rst 60 additions, 0 deletions...ngelog/13.0/Breaking-102645-MoreStrictContextHandling.rst
- typo3/sysext/core/Tests/Functional/Domain/Access/RecordAccessVoterTest.php 10 additions, 8 deletions.../Tests/Functional/Domain/Access/RecordAccessVoterTest.php
- typo3/sysext/core/Tests/Functional/Domain/Repository/PageRepositoryTest.php 48 additions, 54 deletions...Tests/Functional/Domain/Repository/PageRepositoryTest.php
- typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedAliasMapperTest.php 2 additions, 2 deletions...ts/Functional/Routing/Aspect/PersistedAliasMapperTest.php
- typo3/sysext/core/Tests/Functional/Routing/Aspect/PersistedPatternMapperTest.php 2 additions, 2 deletions.../Functional/Routing/Aspect/PersistedPatternMapperTest.php
- typo3/sysext/core/Tests/Unit/Context/ContextTest.php 15 additions, 57 deletionstypo3/sysext/core/Tests/Unit/Context/ContextTest.php
- typo3/sysext/core/Tests/Unit/Database/Query/Restriction/FrontendRestrictionContainerTest.php 4 additions, 5 deletions...se/Query/Restriction/FrontendRestrictionContainerTest.php
- typo3/sysext/core/Tests/Unit/Routing/Aspect/AspectFactoryTest.php 3 additions, 7 deletions...sext/core/Tests/Unit/Routing/Aspect/AspectFactoryTest.php
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Storage/Typo3DbBackendTest.php 3 additions, 4 deletions...tional/Persistence/Generic/Storage/Typo3DbBackendTest.php
Please register or sign in to comment