Skip to content

Commit

Permalink
Fix: Ignore path that can not be resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz authored and sebastianbergmann committed May 7, 2023
1 parent b593754 commit 7cacc86
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ExcludeIterator.php
Expand Up @@ -10,6 +10,7 @@
namespace SebastianBergmann\FileIterator;

use function assert;
use function is_string;
use function str_starts_with;
use RecursiveDirectoryIterator;
use RecursiveFilterIterator;
Expand Down Expand Up @@ -43,6 +44,10 @@ public function accept(): bool

$path = $current->getRealPath();

if (!is_string($path)) {
return false;
}

foreach ($this->exclude as $exclude) {
if (str_starts_with($path, $exclude)) {
return false;
Expand Down

0 comments on commit 7cacc86

Please sign in to comment.