Closed
Description
Symfony version(s) affected
7.2.0
Description
Hi,
When I try to update from Symfony 7.1
to 7.2
. I have an error on cache clear:
$ bin/console cache:clear
In RegisterListenersPass.php line 129:
Service "debug.App\Security\MyCustomAuthenticator" must implement interface "Symfony\Component\EventDispatcher\EventSubscriberInterface".
It seems to be related to:
When I add this code on vendor/symfony/security-bundle/DependencyInjection/SecurityExtension.php
line 646:
if ($container->hasDefinition('debug.security.firewall')) {
foreach ($authenticationProviders as $authenticatorId) {
if ($authenticatorId === MyCustomAuthenticator::class) {
continue;
}
$container->register('debug.'.$authenticatorId, TraceableAuthenticator::class)
->setDecoratedService($authenticatorId)
->setArguments([new Reference('debug.'.$authenticatorId.'.inner')])
;
}
}
It works.
Is it an issue? Why I can't implement EventSubscriberInterface
anymore?
Thanks,
Mickaël
How to reproduce
I created a repository: https://github.com/misaert/test-custom-authenticator/commits/main/.
The last commit is with Symfony 7.2
. Before this, we can launch bin/console cache:clear
but with this commit, we have this error:
$ bin/console cache:clear
In RegisterListenersPass.php line 129:
Service "debug.App\Security\MyCustomAuthenticator" must implement interface "Symfony\Component\EventDispatcher\EventSubscriberInterface".
Possible Solution
No response
Additional Context
No response