vendredi 18 septembre 2020

Since symfony/dependency-injection 5.1: The "Symfony\Component\DependencyInjection\ContainerInterface" autowiring alias is deprecated. [FIXED] [RESOLVED]

 May be a lot of you, have seen this deprecation message while the migration to symfony 5.1.
So here the solution:

Symfony is really discouraging the injection of the global container. To fix the message, all you need to do is to explicitly define the ContainerInterface alias as the Symfony Profiler recommanded you:

# services.yml or yaml
services:
    Symfony\Component\DependencyInjection\ContainerInterface: '@service_container'

Aucun commentaire:

Publier un commentaire