What's Changed
Bug Fixes
SetCsrfEnabledEventListener -- TypeError with Symfony 7.4's SameOriginCsrfTokenManager
Symfony 7.4 introduced SameOriginCsrfTokenManager which implements CsrfTokenManagerInterface but does not extend the concrete CsrfTokenManager class. When Symfony's DI container injects this new implementation the constructor type hint caused a fatal TypeError:
TypeError: Netgen\Bundle\SiteBundle\EventListener\SetCsrfEnabledEventListener::__construct():
Argument #1 ($csrfTokenManager) must be of type ?Symfony\Component\Security\Csrf\CsrfTokenManager,
Symfony\Component\Security\Csrf\SameOriginCsrfTokenManager given
Fix: Changed constructor argument and instanceof check from the concrete CsrfTokenManager class to the CsrfTokenManagerInterface interface, which both CsrfTokenManager and SameOriginCsrfTokenManager implement.
Full Changelog: v5.0.2...v5.0.3