Skip to content

[DependencyInjection] Fix YAML example in "Defining a Service Locator" section #16458

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
Feb 4, 2022

Conversation

jbieliauskas
Copy link
Contributor

Using this example in v5.3.13 gives this error:

Symfony\Component\DependencyInjection\Definition::setArguments(): Argument #1 ($arguments) must be of type array, Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument given, called in /project/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php on line 527

I assume this is because !service_locator is the first constructor argument but it's passed as an array of constructor arguments, in which case the example is not right.

Service locator is a first constructor argument but is passed as an array of constructor arguments.
@carsonbot carsonbot added this to the 4.4 milestone Jan 30, 2022
@carsonbot carsonbot changed the title Fix YAML example in "Defining a Service Locator" section [DependencyInjection] Fix YAML example in "Defining a Service Locator" section Feb 4, 2022
@javiereguiluz
Copy link
Member

Good catch Justas! Thanks and congrats on your first Symfony Docs contribution 🎉

@javiereguiluz javiereguiluz merged commit cc7a726 into symfony:4.4 Feb 4, 2022
@jbieliauskas
Copy link
Contributor Author

@javiereguiluz Will this change be applied to other versions like 5.x, 6.x?

@jbieliauskas jbieliauskas deleted the patch-2 branch February 5, 2022 20:37
@javiereguiluz
Copy link
Member

javiereguiluz commented Feb 5, 2022

Yes, it should be already in all upper and maintained branches. We "upmerge" all Pull Requests. Cheers!

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