Skip to content

Specify service_container parameter explicitly when defining Router#250

Open
gjuric wants to merge 1 commit into
schmittjoh:masterfrom
gjuric:hotfix/psr_container_definition
Open

Specify service_container parameter explicitly when defining Router#250
gjuric wants to merge 1 commit into
schmittjoh:masterfrom
gjuric:hotfix/psr_container_definition

Conversation

@gjuric
Copy link
Copy Markdown

@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