Total Complexity | 5 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
10 | class FindInvalidRouteDefinitionsCommand extends FindInvalidRouteCallsCommand |
||
11 | { |
||
12 | protected $signature = 'runtime-errors:route-definitions'; |
||
13 | protected $description = 'Checks your route definitions to see if they point to an existing controller action'; |
||
14 | protected $routeDefinitions; |
||
15 | |||
16 | public function __construct(FindInvalidRouteDefinitions $routeDefinitions) |
||
21 | } |
||
22 | |||
23 | public function handle() |
||
24 | { |
||
25 | foreach ($this->routeFiles() as $file) { |
||
26 | $this->routeDefinitions->findFunctionCalls($file); |
||
27 | } |
||
28 | |||
29 | $this->routeDefinitions->renderTable($this->getOutput()); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Returns the path to all route files, e.g.: |
||
34 | * routes/api.php |
||
35 | * routes/web.php |
||
36 | * |
||
37 | * @return \Generator |
||
38 | */ |
||
39 | protected function routeFiles() |
||
48 | } |
||
49 | } |
||
51 |