Commit cc7a726
committed
minor #16458 [DependencyInjection] Fix YAML example in "Defining a Service Locator" section (jbieliauskas)
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Fix YAML example in "Defining a Service Locator" section
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.
<!--
If your pull request fixes a BUG, use the oldest maintained branch that contains
the bug (see https://symfony.com/releases for the list of maintained branches).
If your pull request documents a NEW FEATURE, use the same Symfony branch where
the feature was introduced (and `6.x` for features of unreleased versions).
-->
Commits
-------
bd8b262 Fix YAML example in "Defining a Service Locator" section1 file changed
+4
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
260 | | - | |
261 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| |||
0 commit comments