Conditions | 7 |
Paths | 5 |
Total Lines | 35 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function execute(InputInterface $input, OutputInterface $output) |
||
39 | { |
||
40 | $table = new Table($output); |
||
41 | $rows = []; |
||
42 | $table->setHeaders(array('Name', 'Path', 'Method', 'Callback', 'Middleware')); |
||
43 | foreach (route()->aliasMap as $routes) { |
||
44 | foreach ($routes as $route) { |
||
45 | $m = []; |
||
46 | $middleware = $route->getMiddleware(); |
||
47 | if (is_array($middleware)) { |
||
48 | foreach ($middleware as $value) { |
||
49 | if (is_object($value)) { |
||
50 | $m[] = get_class($value); |
||
51 | } else { |
||
52 | $m[] = $value; |
||
53 | } |
||
54 | } |
||
55 | } else if(is_object($middleware)) { |
||
56 | $m[] = get_class($middleware); |
||
57 | } |
||
58 | $rows[] = [ |
||
59 | $route->getName(), |
||
60 | $route->getPath(), |
||
61 | $route->getMethod(), |
||
62 | $route->getCallback(), |
||
63 | implode(',', $m), |
||
64 | ]; |
||
65 | } |
||
66 | |||
67 | } |
||
68 | |||
69 | $table->setRows($rows); |
||
70 | |||
71 | $table->render(); |
||
72 | } |
||
73 | } |