Passed
Push — master ( 3db2bb...2c780f )
by butschster
10:24 queued 15s
created
src/Framework/Command/Router/ListCommand.php 1 patch
Braces   +23 added lines, -11 removed lines patch added patch discarded remove patch
@@ -28,8 +28,10 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $grid = $this->table(['Name:', 'Verbs:', 'Pattern:', 'Target:', 'Group:']);
30 30
 
31
-        foreach ($router->getRoutes() as $name => $route) {
32
-            if ($route instanceof RouteInterface) {
31
+        foreach ($router->getRoutes() as $name => $route)
32
+        {
33
+            if ($route instanceof RouteInterface)
34
+            {
33 35
                 $grid->addRow(
34 36
                     [
35 37
                         $name,
@@ -53,8 +55,10 @@  discard block
 block discarded – undo
53 55
     private function getRouteGroups(GroupRegistry $registry, string $routeName): array
54 56
     {
55 57
         $groups = [];
56
-        foreach ($registry as $groupName => $group) {
57
-            if ($group->hasRoute($routeName)) {
58
+        foreach ($registry as $groupName => $group)
59
+        {
60
+            if ($group->hasRoute($routeName))
61
+            {
58 62
                 $groups[] = $groupName;
59 63
             }
60 64
         }
@@ -64,12 +68,14 @@  discard block
 block discarded – undo
64 68
 
65 69
     private function getVerbs(RouteInterface $route): string
66 70
     {
67
-        if ($route->getVerbs() === RouteInterface::VERBS) {
71
+        if ($route->getVerbs() === RouteInterface::VERBS)
72
+        {
68 73
             return '*';
69 74
         }
70 75
 
71 76
         $result = [];
72
-        foreach ($route->getVerbs() as $verb) {
77
+        foreach ($route->getVerbs() as $verb)
78
+        {
73 79
             $result[] = match (\strtolower($verb)) {
74 80
                 'get' => '<fg=green>GET</>',
75 81
                 'post' => '<fg=blue>POST</>',
@@ -109,7 +115,8 @@  discard block
 block discarded – undo
109 115
     private function getTarget(RouteInterface $route, KernelInterface $kernel): string
110 116
     {
111 117
         $target = $this->getValue($route, 'target');
112
-        switch (true) {
118
+        switch (true)
119
+        {
113 120
             case $target instanceof \Closure:
114 121
                 $reflection = new \ReflectionFunction($target);
115 122
 
@@ -134,7 +141,8 @@  discard block
 block discarded – undo
134 141
 
135 142
             case $target instanceof Group:
136 143
                 $result = [];
137
-                foreach ($this->getValue($target, 'controllers') as $alias => $class) {
144
+                foreach ($this->getValue($target, 'controllers') as $alias => $class)
145
+                {
138 146
                     $result[] = \sprintf('%s => %s', $alias, $this->relativeClass($class, $kernel));
139 147
                 }
140 148
 
@@ -153,10 +161,13 @@  discard block
 block discarded – undo
153 161
 
154 162
     private function getValue(object $object, string $property): mixed
155 163
     {
156
-        try {
164
+        try
165
+        {
157 166
             $r = new \ReflectionObject($object);
158 167
             $prop = $r->getProperty($property);
159
-        } catch (\Throwable $e) {
168
+        }
169
+        catch (\Throwable $e)
170
+        {
160 171
             return $e->getMessage();
161 172
         }
162 173
 
@@ -167,7 +178,8 @@  discard block
 block discarded – undo
167 178
     {
168 179
         $r = new \ReflectionObject($kernel);
169 180
 
170
-        if (\str_starts_with($class, $r->getNamespaceName())) {
181
+        if (\str_starts_with($class, $r->getNamespaceName()))
182
+        {
171 183
             return \substr($class, \strlen($r->getNamespaceName()) + 1);
172 184
         }
173 185
 
Please login to merge, or discard this patch.