| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ArtisanUI |
||
| 9 | { |
||
| 10 | public function commands() |
||
| 11 | { |
||
| 12 | return array_values(array_filter(Artisan::all(), function ($command) { |
||
| 13 | return ! in_array($this->getNamespace($command), $this->ignoredNamespaces()); |
||
| 14 | })); |
||
| 15 | } |
||
| 16 | |||
| 17 | public function names() |
||
| 18 | { |
||
| 19 | return array_keys($this->commands()); |
||
| 20 | } |
||
| 21 | |||
| 22 | public function namespaces() |
||
| 23 | { |
||
| 24 | return array_values(array_unique(array_map(function ($command) { |
||
| 25 | return $this->getNamespace($command); |
||
| 26 | }, $this->commands()))); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getNamespace(Command $command) |
||
| 30 | { |
||
| 31 | return explode(':', $command->getName())[0]; |
||
|
|
|||
| 32 | } |
||
| 33 | |||
| 34 | public function ignoredNamespaces() |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | } |
||
| 42 |