File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace BeyondCode \ErdGenerator ;
4
4
5
+ use Illuminate \Support \Str ;
5
6
use PhpParser \NodeTraverser ;
6
7
use PhpParser \ParserFactory ;
7
8
use PhpParser \Node \Stmt \Class_ ;
8
- use PhpParser \Node \Stmt \Namespace_ ;
9
9
use Illuminate \Support \Collection ;
10
+ use PhpParser \Node \Stmt \Namespace_ ;
10
11
use Illuminate \Filesystem \Filesystem ;
11
12
use PhpParser \NodeVisitor \NameResolver ;
12
13
use Illuminate \Database \Eloquent \Model as EloquentModel ;
@@ -28,7 +29,9 @@ public function getModelsInDirectory(string $directory): Collection
28
29
$ this ->filesystem ->allFiles ($ directory ) :
29
30
$ this ->filesystem ->files ($ directory );
30
31
31
- return Collection::make ($ files )->map (function ($ path ) {
32
+ return Collection::make ($ files )->filter (function ($ path ) {
33
+ return Str::endsWith ($ path , '.php ' );
34
+ })->map (function ($ path ) {
32
35
return $ this ->getFullyQualifiedClassNameFromFile ($ path );
33
36
})->filter (function (string $ className ) {
34
37
return !empty ($ className );
You can’t perform that action at this time.
0 commit comments