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