Skip to content

Commit

Permalink
scan only php files
Browse files Browse the repository at this point in the history
  • Loading branch information
faissaloux committed Oct 9, 2024
1 parent dcf4876 commit faa3bae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"Faissaloux\\PestInside\\": "src/"
},
"files": [
"src/helpers.php",
"src/Autoload.php"
]
},
Expand Down
1 change: 1 addition & 0 deletions src/Expectation.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function (): PestExpectation {

if ($files = scandir($files[0])) {
$files = array_diff($files, ['.', '..']);
$files = array_filter($files, 'isPhp');
$files = array_map(fn (string $file): string => $directory.DIRECTORY_SEPARATOR.$file, $files);
}

Expand Down
8 changes: 8 additions & 0 deletions src/helpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

function isPhp(string $file): bool
{
$exploded = explode(".", $file);

return end($exploded) === "php";
}

0 comments on commit faa3bae

Please sign in to comment.