Skip to content

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