Skip to content

Commit

Permalink
[Skipper] Prevent unnecessary IO (#3664)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Apr 23, 2023
1 parent 54663e7 commit dc57cff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions packages/Skipper/RealpathMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ final class RealpathMatcher
public function match(string $matchingPath, string $filePath): bool
{
$realPathMatchingPath = realpath($matchingPath);
$realpathFilePath = realpath($filePath);

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

$realpathFilePath = realpath($filePath);
if (! is_string($realpathFilePath)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function resolve(): array
continue;
}

if (file_exists($value)) {
if (\str_contains((string) $value, '*')) {
$this->skippedPaths[] = $this->filePathHelper->normalizePathAndSchema($value);
continue;
}

if (\str_contains((string) $value, '*')) {
if (file_exists($value)) {
$this->skippedPaths[] = $this->filePathHelper->normalizePathAndSchema($value);
}
}
Expand Down

0 comments on commit dc57cff

Please sign in to comment.