Skip to content

Commit 4c6ebd9

Browse files
committed
Suppress warnings when calling scandir().
1 parent cdcc334 commit 4c6ebd9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/ClassFilesIA/ClassFilesIA_NamespaceDirectoryPsr4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getIterator(): \Iterator {
8989
* Format: $[$file] = $class
9090
*/
9191
private static function scan(string $dir, string $terminatedNamespace): \Iterator {
92-
$candidates = \scandir($dir, \SCANDIR_SORT_ASCENDING);
92+
$candidates = @\scandir($dir, \SCANDIR_SORT_ASCENDING);
9393
if ($candidates === false) {
9494
throw new \RuntimeException("Failed to scandir('$dir').");
9595
}

src/NamespaceDirectory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ private function scanThisDir(): array {
667667
* would be redundant to do additional filtering here.
668668
*/
669669
private static function scanKnownDir(string $dir): array {
670-
$candidates = \scandir($dir, \SCANDIR_SORT_ASCENDING);
670+
$candidates = @\scandir($dir, \SCANDIR_SORT_ASCENDING);
671671
if ($candidates === false) {
672672
throw new \RuntimeException("Failed to scandir('$dir').");
673673
}

0 commit comments

Comments
 (0)