Skip to content

Commit

Permalink
Finder: getType() replaced with isDir() / isFile()
Browse files Browse the repository at this point in the history
- getType() throws an exception when the file (no longer) exists
- there is a difference regarding handling of symlinks [#295]
  • Loading branch information
dg committed Sep 19, 2023
1 parent 71017d2 commit 6ffe33b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Utils/Finder.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ private function traverseDir(string $dir, array $searches, array $subdirs = []):
$relativePathname = FileSystem::unixSlashes($file->getRelativePathname());
foreach ($searches as $search) {
if (
$file->getType() === $search->mode
$file->{'is' . $search->mode}()
&& preg_match($search->pattern, $relativePathname)
&& $this->proveFilters($this->filters, $file, $cache)
) {
Expand Down

0 comments on commit 6ffe33b

Please sign in to comment.