Skip to content

Commit

Permalink
fix: not a file
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Jun 8, 2024
1 parent 98dbc7f commit 22c840f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Support/FileLineFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ final class FileLineFinder
public static function where(callable $callback): callable
{
return function (string $path) use ($callback): int {
if (file_exists($path) === false) {
return 0;
}

$contents = (string) file_get_contents($path);

foreach (explode("\n", $contents) as $line => $content) {
Expand Down

0 comments on commit 22c840f

Please sign in to comment.