| Conditions | 1 |
| Paths | 1 |
| Total Lines | 30 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getMigrationFiles($paths): array |
||
| 33 | { |
||
| 34 | return collect($paths) |
||
| 35 | ->flatMap( |
||
| 36 | function ($path) { |
||
| 37 | return collect( |
||
| 38 | (new Finder)->in([$path]) |
||
| 39 | ->files() |
||
| 40 | ) |
||
| 41 | ->map( |
||
| 42 | function ($file) { |
||
| 43 | return $file->getPathname(); |
||
| 44 | } |
||
| 45 | ) |
||
| 46 | ->all(); |
||
| 47 | } |
||
| 48 | ) |
||
| 49 | ->filter() |
||
| 50 | ->sortBy( |
||
| 51 | function ($file) { |
||
| 52 | return $this->getMigrationName($file); |
||
| 53 | } |
||
| 54 | ) |
||
| 55 | ->values() |
||
| 56 | ->keyBy( |
||
| 57 | function ($file) { |
||
| 58 | return $this->getMigrationName($file); |
||
| 59 | } |
||
| 60 | ) |
||
| 61 | ->all(); |
||
| 62 | } |
||
| 64 |