update patch 1
This commit is contained in:
Vendored
+2
-6
@@ -643,7 +643,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
sort($glob);
|
||||
$resolvedDirs[] = array_map($this->normalizeDir(...), $glob);
|
||||
} else {
|
||||
throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir));
|
||||
throw new DirectoryNotFoundException(\sprintf('The "%s" directory does not exist.', $dir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -699,8 +699,6 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
* The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array.
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
* @throws \InvalidArgumentException when the given argument is not iterable
|
||||
*/
|
||||
public function append(iterable $iterator): static
|
||||
{
|
||||
@@ -708,15 +706,13 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
$this->iterators[] = $iterator->getIterator();
|
||||
} elseif ($iterator instanceof \Iterator) {
|
||||
$this->iterators[] = $iterator;
|
||||
} elseif (is_iterable($iterator)) {
|
||||
} else {
|
||||
$it = new \ArrayIterator();
|
||||
foreach ($iterator as $file) {
|
||||
$file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file);
|
||||
$it[$file->getPathname()] = $file;
|
||||
}
|
||||
$this->iterators[] = $it;
|
||||
} else {
|
||||
throw new \InvalidArgumentException('Finder::append() method wrong argument type.');
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user