Passed
Pull Request — master (#253)
by
unknown
02:34
created
src/Command/Router/ListCommand.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     {
43 43
         $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']);
44 44
 
45
-        foreach ($router->getRoutes() as $route) {
46
-            if ($route instanceof Route) {
45
+        foreach ($router->getRoutes() as $route){
46
+            if ($route instanceof Route){
47 47
                 $grid->addRow(
48 48
                     [
49 49
                         $this->getVerbs($route),
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
      */
64 64
     private function getVerbs(Route $route): string
65 65
     {
66
-        if ($route->getVerbs() === Route::VERBS) {
66
+        if ($route->getVerbs() === Route::VERBS){
67 67
             return '*';
68 68
         }
69 69
 
70 70
         $result = [];
71 71
 
72
-        foreach ($route->getVerbs() as $verb) {
73
-            switch (strtolower($verb)) {
72
+        foreach ($route->getVerbs() as $verb){
73
+            switch (strtolower($verb)){
74 74
                 case 'get':
75 75
                     $verb = '<fg=green>GET</>';
76 76
                     break;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         return preg_replace_callback(
108 108
             '/<([^>]*)>/',
109
-            static function ($m) {
109
+            static function ($m){
110 110
                 return sprintf('<fg=magenta>%s</>', $m[0]);
111 111
             },
112 112
             $pattern
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
     private function getTarget(Route $route, KernelInterface $kernel): string
124 124
     {
125 125
         $target = $this->getValue($route, 'target');
126
-        switch (true) {
126
+        switch (true){
127 127
             case $target instanceof Closure:
128 128
                 $reflection = new ReflectionFunction($target);
129 129
                 return sprintf(
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 return sprintf(
137 137
                     '%s->%s',
138 138
                     $this->relativeClass($this->getValue($target, 'controller'), $kernel),
139
-                    join('|', (array) $this->getValue($target, 'action'))
139
+                    join('|', (array)$this->getValue($target, 'action'))
140 140
                 );
141 141
 
142 142
             case $target instanceof Controller:
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
             case $target instanceof Group:
149 149
                 $result = [];
150
-                foreach ($this->getValue($target, 'controllers') as $alias => $class) {
150
+                foreach ($this->getValue($target, 'controllers') as $alias => $class){
151 151
                     $result[] = sprintf('%s => %s', $alias, $this->relativeClass($class, $kernel));
152 152
                 }
153 153
 
@@ -171,11 +171,11 @@  discard block
 block discarded – undo
171 171
      */
172 172
     private function getValue(object $object, string $property)
173 173
     {
174
-        try {
174
+        try{
175 175
             $r = new ReflectionObject($object);
176 176
             $prop = $r->getProperty($property);
177 177
             $prop->setAccessible(true);
178
-        } catch (Throwable $e) {
178
+        }catch (Throwable $e){
179 179
             return $e->getMessage();
180 180
         }
181 181
 
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $r = new ReflectionObject($kernel);
193 193
         $r->getNamespaceName();
194 194
 
195
-        if (strpos($class, $r->getNamespaceName()) === 0) {
195
+        if (strpos($class, $r->getNamespaceName()) === 0){
196 196
             return substr($class, strlen($r->getNamespaceName()) + 1);
197 197
         }
198 198
 
Please login to merge, or discard this patch.