Skip to content

[DependencyInjection] Update configurators.rst #16586

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

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

PierreJoube
Copy link
Contributor

@PierreJoube PierreJoube commented Mar 10, 2022

The first configuration example (PHP) at https://symfony.com/doc/current/service_container/configurators.html#using-the-configurator will never work because ConfiguratorTrait::configurator(string|array|ReferenceConfigurator $configurator) expect only one parameter. Configurator will try to call special __invoke() (which is probably undefined at this point) method while the user expects to call configure() method. We must provide an array in this case.

The first example at https://symfony.com/doc/current/service_container/configurators.html#using-the-configurator will never work because ConfiguratorTrait::configurator(string|array|ReferenceConfigurator $configurator) expect only one parameter. Configurator will try to call special __invoke() (which is probably undefined at this point) method while the user expects to call configure() method. We must provide an array in this case.
@carsonbot carsonbot added this to the 5.4 milestone Mar 10, 2022
@carsonbot carsonbot changed the title Update configurators.rst [DependencyInjection] Update configurators.rst Mar 11, 2022
@javiereguiluz
Copy link
Member

Good catch, thanks Pierre.

@javiereguiluz javiereguiluz merged commit 5d6893f into symfony:5.4 Mar 11, 2022
@PierreJoube PierreJoube deleted the patch-2 branch March 11, 2022 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants