Skip to content

Commit 3e915e5

Browse files
hurricane-voroninnicolas-grekas
authored andcommitted
[Config] Disable default alphabet sorting in glob function due of unstable sort
1 parent 2b6a666 commit 3e915e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Finder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,8 @@ public function in($dirs)
541541
foreach ((array) $dirs as $dir) {
542542
if (is_dir($dir)) {
543543
$resolvedDirs[] = $this->normalizeDir($dir);
544-
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR)) {
544+
} elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? GLOB_BRACE : 0) | GLOB_ONLYDIR | GLOB_NOSORT)) {
545+
sort($glob);
545546
$resolvedDirs = array_merge($resolvedDirs, array_map([$this, 'normalizeDir'], $glob));
546547
} else {
547548
throw new \InvalidArgumentException(sprintf('The "%s" directory does not exist.', $dir));

0 commit comments

Comments
 (0)