I just made the migration from symfony 4.1 to 4.4I have this error:
Argument 1 passed to App\EventListener\KernelRequestListener::__construct() must be an instance of Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage, instance of Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage given, called in C:\xampp\htdocs\chat-project-symfony\var\cache\dev\Container06Mjwya\srcApp_KernelDevDebugContainer.php on line 1130
While if you look at my KernelRequestListener
:
<?phpnamespace App\EventListener;use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;//..class KernelRequestListener{ private $tokenStorage; /** * KernelRequestListener constructor. * @param TokenStorage $tokenStorage * ... */ public function __construct(TokenStorage $tokenStorage/*...*/) { $this->tokenStorage = $tokenStorage; //.. }}
Here is my config/services.yaml
file:
#...services: #.. App\EventListener\KernelRequestListener: arguments: [ '@security.token_storage' ] tags: - { name: kernel.event_listener, event: kernel.request } - { name: kernel.event_listener, event: kernel.response }
I don't know why symfony tell me that I'm using Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage
while it's clearing written Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage
I already tried to clear the cache folder and also delete the cache folder and it didn't change.
How can I fix this ?
Thank you