mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-25 04:09:11 -04:00
ALPHA 3.0.2a
This commit is contained in:
8
vendor/symfony/finder/Finder.php
vendored
8
vendor/symfony/finder/Finder.php
vendored
@@ -541,7 +541,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
foreach ((array) $dirs as $dir) {
|
||||
if (is_dir($dir)) {
|
||||
$resolvedDirs[] = $this->normalizeDir($dir);
|
||||
} elseif ($glob = glob($dir, (defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
|
||||
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
|
||||
$resolvedDirs = array_merge($resolvedDirs, array_map(array($this, 'normalizeDir'), $glob));
|
||||
} else {
|
||||
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));
|
||||
@@ -564,11 +564,11 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
*/
|
||||
public function getIterator()
|
||||
{
|
||||
if (0 === count($this->dirs) && 0 === count($this->iterators)) {
|
||||
if (0 === \count($this->dirs) && 0 === \count($this->iterators)) {
|
||||
throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.');
|
||||
}
|
||||
|
||||
if (1 === count($this->dirs) && 0 === count($this->iterators)) {
|
||||
if (1 === \count($this->dirs) && 0 === \count($this->iterators)) {
|
||||
return $this->searchInDirectory($this->dirs[0]);
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ class Finder implements \IteratorAggregate, \Countable
|
||||
$this->iterators[] = $iterator->getIterator();
|
||||
} elseif ($iterator instanceof \Iterator) {
|
||||
$this->iterators[] = $iterator;
|
||||
} elseif ($iterator instanceof \Traversable || is_array($iterator)) {
|
||||
} elseif ($iterator instanceof \Traversable || \is_array($iterator)) {
|
||||
$it = new \ArrayIterator();
|
||||
foreach ($iterator as $file) {
|
||||
$it->append($file instanceof \SplFileInfo ? $file : new \SplFileInfo($file));
|
||||
|
||||
Reference in New Issue
Block a user