Skip to content

Commit f638807

Browse files
committed
minor #42151 Use is_iterable() function when possible (javiereguiluz)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- Use is_iterable() function when possible | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - PHP added `is_iterable()` in PHP 7.1.0 (see https://www.php.net/manual/en/function.is-iterable.php) and Symfony 4.4 requires `>=7.1.3`, so maybe we can use this function to simplify some code. Commits ------- 6919c1317d Use is_iterable() function when possible
2 parents dcc7738 + 860a301 commit f638807

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Finder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ public function append($iterator)
669669
$this->iterators[] = $iterator->getIterator();
670670
} elseif ($iterator instanceof \Iterator) {
671671
$this->iterators[] = $iterator;
672-
} elseif ($iterator instanceof \Traversable || \is_array($iterator)) {
672+
} elseif (is_iterable($iterator)) {
673673
$it = new \ArrayIterator();
674674
foreach ($iterator as $file) {
675675
$file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);

0 commit comments

Comments
 (0)