Skip to content
Snippets Groups Projects
Commit 75732ef9 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[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: default avatarcore-ci <typo3@b1...>
parent 47cd167f
Showing
with 416 additions and 229 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