Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
pelmered committed Jun 11, 2024
1 parent 05c4066 commit 16fc3d0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/VaporIgnore.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static function get(): LazyCollection
$baseDir = dirname($path);

return static::getLines($path)->map(function ($line) use ($baseDir) {
return static::parseLine($baseDir,$line);
return static::parseLine($baseDir, $line);
})->flatten()->filter();
}

Expand Down Expand Up @@ -45,15 +45,18 @@ protected static function parseLine($baseDir, $line): array
case '#':
return [];
default:
return Arr::map(glob($baseDir.'/'.trim($line, '/')), function ($path) use ($baseDir) {
return Str::of($path)
->after($baseDir)
->trim('/')
->pipe(function ($line) {
return '/^'.preg_quote($line, '/').'/';
})
->toString();
});
return Arr::map(
glob($baseDir.'/'.trim($line, '/')),
function ($path) use ($baseDir) {
return Str::of($path)
->after($baseDir)
->trim('/')
->pipe(function ($line) {
return '/^'.preg_quote($line, '/').'/';
})
->toString();
}
);
}

}
Expand Down

0 comments on commit 16fc3d0

Please sign in to comment.