Commit b01a241
committed
minor #14729 [DependencyInjection] Fix possible error in example code (sp1ker)
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead.
Discussion
----------
[DependencyInjection] Fix possible error in example code
Pseudo-type `iterable` accepts any `array` or `object` implementing the `Traversable` interface. Constructor will be crashed when we try to pass array instead of `Traversable` and use `iterator_to_array`.
`iterator_to_array` dont work with arrays.
Then if always passing `Traversable` we could write like this:
```php
public function __construct(Traversable $handlers)
```
or check instance of `Traversable`.
<!--
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 `5.x` for features of unreleased versions).
-->
Commits
-------
74d460e Fix possible error code1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
798 | 798 | | |
799 | 799 | | |
800 | 800 | | |
801 | | - | |
| 801 | + | |
802 | 802 | | |
803 | 803 | | |
804 | 804 | | |
| |||
0 commit comments