Skip to content

Trigger a E_USER_DEPRECATED when I used a deprecated service #14307

@jderusse

Description

@jderusse

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy