Skip to content

Commit 6de263e

Browse files
Remove always true/false occurrences
1 parent b98a9af commit 6de263e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Finder.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,24 +699,20 @@ public function getIterator(): \Iterator
699699
* The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
700700
*
701701
* @return $this
702-
*
703-
* @throws \InvalidArgumentException when the given argument is not iterable
704702
*/
705703
public function append(iterable $iterator): static
706704
{
707705
if ($iterator instanceof \IteratorAggregate) {
708706
$this->iterators[] = $iterator->getIterator();
709707
} elseif ($iterator instanceof \Iterator) {
710708
$this->iterators[] = $iterator;
711-
} elseif (is_iterable($iterator)) {
709+
} else {
712710
$it = new \ArrayIterator();
713711
foreach ($iterator as $file) {
714712
$file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);
715713
$it[$file->getPathname()] = $file;
716714
}
717715
$this->iterators[] = $it;
718-
} else {
719-
throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
720716
}
721717

722718
return $this;

0 commit comments

Comments
 (0)