schmittjoh / JMSI18nRoutingBundle

Allows you to internationalize your routing
http://jmsyst.com/bundles/JMSI18nRoutingBundle
358 stars 159 forks source link

Specify service_container parameter explicitly when defining Router #250

Open gjuric opened 2 years ago

gjuric commented 2 years ago

jms_i18n_routing.router service definition uses frameworks router.default service as a parent in it's definition. The parent relies on autowiring to inject Psr\Container\ContainerInterface as a first parameter.

Autowiring of ContainerInterface has been deprecated since Symfony 5.1 and services using it need to define this parameter explicitly or Symfony triggers the following deprecation warning:

Since symfony/dependency-injection 5.1: The "Psr\Container\ContainerInterface" autowiring alias is deprecated. Define it explicitly in your app if you want to keep using it. It is being referenced by the "jms_i18n_routing.router" service.

I've checked all existing Symfony versions and Container is always the first parameter, but there is a potential for a breaking change with new Symfony versions if they decide to switch it's position in the constructor definition (unlikely).

This PR fixes #249.