Description
The dev bar outputs the following in the tab for "logs".
DEPRECATED - The Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter class is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead.
It is not documented anywhere I can see how to deal with this. I upgraded a project from 2.5 to 2.7 and now I get a lot of these errors. All of which I was able to solve, but the CSRF token issue is a mystery.
The default configuration has this
<service id="form.csrf_provider" class="Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter">
<argument type="service" id="security.csrf.token_manager" />
</service>
But the file Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter states
public function getTokenManager($triggerDeprecationError = true)
{
if ($triggerDeprecationError) {
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead.', E_USER_DEPRECATED);
}
return $this->tokenManager;
}
/**
* {@inheritdoc}
*/
public function generateCsrfToken($intention)
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead.', E_USER_DEPRECATED);
return $this->tokenManager->getToken($intention)->getValue();
}
Only things I can find online are suggestions to disable warnings in my php.ini etc. Considering I solved the other issues surely there is a way to appropriate fix this issue while upgrading also?
These warnings are incredibly invasive BTW, not good for DX.