[TASK] Replace instance cache in FormProtectionFactory
Implementing class internal caches has been done in the past, which however came with a lot of headaches. Mainly in tests it's a epic quest to properly clear the state between test runs, but it's not a good design at all. Some work has been already done to make static class `\TYPO3\CMS\Core\FormProtection\FormProtectionFactory` injectable through the DI container, which moved some parts from static to the instance part. This allows us to transform methods from static to non-static. This change injects the runtime cache, if the class is instanciated through the DI. Thus the internal static property cache for instances is removed. Tests are adjusted. TestCases testing deprecated method are moved to the UnitDeprecated to avoid failing tests. Resolves: #99098 Related: #98696 Related: #98627 Releases: main Change-Id: Ib92bb9f73f3b1bbb4995ef01c53ca973588528bd Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/76634 Tested-by:core-ci <typo3@b1...>
Showing
- typo3/sysext/backend/Tests/Functional/Controller/MfaConfigurationControllerTest.php 0 additions, 7 deletions.../Functional/Controller/MfaConfigurationControllerTest.php
- typo3/sysext/backend/Tests/Functional/Controller/MfaControllerTest.php 0 additions, 7 deletions...backend/Tests/Functional/Controller/MfaControllerTest.php
- typo3/sysext/core/Classes/FormProtection/FormProtectionFactory.php 77 additions, 111 deletions...ext/core/Classes/FormProtection/FormProtectionFactory.php
- typo3/sysext/core/Classes/ServiceProvider.php 2 additions, 0 deletionstypo3/sysext/core/Classes/ServiceProvider.php
- typo3/sysext/core/Documentation/Changelog/12.1/Deprecation-99098-StaticUsageOfFormProtectionFactory.rst 140 additions, 0 deletions.../Deprecation-99098-StaticUsageOfFormProtectionFactory.rst
- typo3/sysext/core/Tests/Functional/Authentication/Mfa/Provider/RecoveryCodesProviderTest.php 0 additions, 7 deletions...Authentication/Mfa/Provider/RecoveryCodesProviderTest.php
- typo3/sysext/core/Tests/Unit/Authentication/BackendUserAuthenticationTest.php 5 additions, 7 deletions...sts/Unit/Authentication/BackendUserAuthenticationTest.php
- typo3/sysext/core/Tests/Unit/FormProtection/FormProtectionFactoryTest.php 11 additions, 90 deletions...e/Tests/Unit/FormProtection/FormProtectionFactoryTest.php
- typo3/sysext/core/Tests/UnitDeprecated/FormProtection/FormProtectionFactoryTest.php 167 additions, 0 deletions...itDeprecated/FormProtection/FormProtectionFactoryTest.php
- typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallStaticMatcher.php 14 additions, 0 deletions...guration/ExtensionScanner/Php/MethodCallStaticMatcher.php
Please register or sign in to comment