Review main Merged

76634[TASK] Replace instance cache in FormProtectionFactory

Stefan Bürk CR +2 V +2 Hard +416 −229 updated 11/16/22, 13:22

Commit message

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.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 3

Files 10