@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $grid = $this->table(['Name:', 'Verbs:', 'Pattern:', 'Target:']); |
| 44 | 44 | |
| 45 | - foreach ($router->getRoutes() as $name => $route) { |
|
| 46 | - if ($route instanceof Route) { |
|
| 45 | + foreach ($router->getRoutes() as $name => $route){ |
|
| 46 | + if ($route instanceof Route){ |
|
| 47 | 47 | $grid->addRow( |
| 48 | 48 | [ |
| 49 | 49 | $name, |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | private function getVerbs(Route $route): string |
| 66 | 66 | { |
| 67 | - if ($route->getVerbs() === Route::VERBS) { |
|
| 67 | + if ($route->getVerbs() === Route::VERBS){ |
|
| 68 | 68 | return '*'; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $result = []; |
| 72 | 72 | |
| 73 | - foreach ($route->getVerbs() as $verb) { |
|
| 74 | - switch (strtolower($verb)) { |
|
| 73 | + foreach ($route->getVerbs() as $verb){ |
|
| 74 | + switch (strtolower($verb)){ |
|
| 75 | 75 | case 'get': |
| 76 | 76 | $verb = '<fg=green>GET</>'; |
| 77 | 77 | break; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | return preg_replace_callback( |
| 109 | 109 | '/<([^>]*)>/', |
| 110 | - static function ($m) { |
|
| 110 | + static function ($m){ |
|
| 111 | 111 | return sprintf('<fg=magenta>%s</>', $m[0]); |
| 112 | 112 | }, |
| 113 | 113 | $pattern |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | private function getTarget(Route $route, KernelInterface $kernel): string |
| 125 | 125 | { |
| 126 | 126 | $target = $this->getValue($route, 'target'); |
| 127 | - switch (true) { |
|
| 127 | + switch (true){ |
|
| 128 | 128 | case $target instanceof Closure: |
| 129 | 129 | $reflection = new ReflectionFunction($target); |
| 130 | 130 | return sprintf( |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | return sprintf( |
| 138 | 138 | '%s->%s', |
| 139 | 139 | $this->relativeClass($this->getValue($target, 'controller'), $kernel), |
| 140 | - join('|', (array) $this->getValue($target, 'action')) |
|
| 140 | + join('|', (array)$this->getValue($target, 'action')) |
|
| 141 | 141 | ); |
| 142 | 142 | |
| 143 | 143 | case $target instanceof Controller: |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | case $target instanceof Group: |
| 150 | 150 | $result = []; |
| 151 | - foreach ($this->getValue($target, 'controllers') as $alias => $class) { |
|
| 151 | + foreach ($this->getValue($target, 'controllers') as $alias => $class){ |
|
| 152 | 152 | $result[] = sprintf('%s => %s', $alias, $this->relativeClass($class, $kernel)); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -174,11 +174,11 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | private function getValue(object $object, string $property) |
| 176 | 176 | { |
| 177 | - try { |
|
| 177 | + try{ |
|
| 178 | 178 | $r = new ReflectionObject($object); |
| 179 | 179 | $prop = $r->getProperty($property); |
| 180 | 180 | $prop->setAccessible(true); |
| 181 | - } catch (Throwable $e) { |
|
| 181 | + }catch (Throwable $e){ |
|
| 182 | 182 | return $e->getMessage(); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $r = new ReflectionObject($kernel); |
| 196 | 196 | $r->getNamespaceName(); |
| 197 | 197 | |
| 198 | - if (strpos($class, $r->getNamespaceName()) === 0) { |
|
| 198 | + if (strpos($class, $r->getNamespaceName()) === 0){ |
|
| 199 | 199 | return substr($class, strlen($r->getNamespaceName()) + 1); |
| 200 | 200 | } |
| 201 | 201 | |