-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
My current problem is the following:
I upgrade a legacy application to 2.8. And I've now a E_USER_DEPRECATED
: Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter class is deprecated since version 2.4
.
I search a lot and found that the problem was the parameter csrf_provider
in security.yml
who's defined to the service form.csrf_provider
. Finally this service use the deprecated class CsrfTokenManagerAdapter
which let FormTypeCsrfExtension
to instanciate a CsrfProviderAdapter
... ouch.. hard to debug and find the source of the deprecation.
An idea to help is such case, is to trigger the E_USER_DEPRECATED
earlier.
We (@nicolas-grekas and me) thinks that it could be ncie to trigger the error when the service is retreived from the container: A solution => When the container is compiled, we can Reflect the class defined in the service, and, automaticly add a trigger_error if the @deprecated
annotation is found.