Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify service_container parameter explicitly when defining Router #250

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gjuric
Copy link

@gjuric gjuric commented Sep 1, 2021

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The "Psr\Container\ContainerInterface" autowiring alias is deprecated
1 participant