Passed
Pull Request — master (#230)
by Anton
02:22
created
src/Command/Router/DebugCommand.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']);
25 25
 
26
-        foreach ($this->getRoutes($router) as $name => $route) {
27
-            if ($route instanceof Route) {
26
+        foreach ($this->getRoutes($router) as $name => $route){
27
+            if ($route instanceof Route){
28 28
                 $this->renderRoute($grid, $name, $route);
29 29
             }
30 30
         }
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $result = [];
67 67
 
68
-        foreach ($route->getVerbs() as $verb) {
69
-            switch (strtolower($verb)) {
68
+        foreach ($route->getVerbs() as $verb){
69
+            switch (strtolower($verb)){
70 70
                 case 'get':
71 71
                     $verb = '<fg=green>GET</>';
72 72
                     break;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         return preg_replace_callback(
104 104
             '/<([^>]*)>/',
105
-            static function ($m) {
105
+            static function ($m){
106 106
                 return sprintf('<fg=yellow>%s</>', $m[0]);
107 107
             },
108 108
             $pattern
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     private function getTarget(Route $route): string
117 117
     {
118 118
         $target = $this->getValue($route, 'target');
119
-        switch (true) {
119
+        switch (true){
120 120
             case $target instanceof Action:
121 121
                 return sprintf(
122 122
                     '%s::%s',
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function getValue(object $object, string $property)
138 138
     {
139
-        try {
139
+        try{
140 140
             $r = new \ReflectionObject($object);
141 141
             $prop = $r->getProperty($property);
142 142
             $prop->setAccessible(true);
143
-        } catch (\Throwable $e) {
143
+        }catch (\Throwable $e){
144 144
             return $e->getMessage();
145 145
         }
146 146
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,8 +23,10 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']);
25 25
 
26
-        foreach ($this->getRoutes($router) as $name => $route) {
27
-            if ($route instanceof Route) {
26
+        foreach ($this->getRoutes($router) as $name => $route)
27
+        {
28
+            if ($route instanceof Route)
29
+            {
28 30
                 $this->renderRoute($grid, $name, $route);
29 31
             }
30 32
         }
@@ -65,8 +67,10 @@  discard block
 block discarded – undo
65 67
     {
66 68
         $result = [];
67 69
 
68
-        foreach ($route->getVerbs() as $verb) {
69
-            switch (strtolower($verb)) {
70
+        foreach ($route->getVerbs() as $verb)
71
+        {
72
+            switch (strtolower($verb))
73
+            {
70 74
                 case 'get':
71 75
                     $verb = '<fg=green>GET</>';
72 76
                     break;
@@ -102,7 +106,8 @@  discard block
 block discarded – undo
102 106
 
103 107
         return preg_replace_callback(
104 108
             '/<([^>]*)>/',
105
-            static function ($m) {
109
+            static function ($m)
110
+            {
106 111
                 return sprintf('<fg=yellow>%s</>', $m[0]);
107 112
             },
108 113
             $pattern
@@ -116,7 +121,8 @@  discard block
 block discarded – undo
116 121
     private function getTarget(Route $route): string
117 122
     {
118 123
         $target = $this->getValue($route, 'target');
119
-        switch (true) {
124
+        switch (true)
125
+        {
120 126
             case $target instanceof Action:
121 127
                 return sprintf(
122 128
                     '%s::%s',
@@ -136,11 +142,14 @@  discard block
 block discarded – undo
136 142
      */
137 143
     private function getValue(object $object, string $property)
138 144
     {
139
-        try {
145
+        try
146
+        {
140 147
             $r = new \ReflectionObject($object);
141 148
             $prop = $r->getProperty($property);
142 149
             $prop->setAccessible(true);
143
-        } catch (\Throwable $e) {
150
+        }
151
+        catch (\Throwable $e)
152
+        {
144 153
             return $e->getMessage();
145 154
         }
146 155
 
Please login to merge, or discard this patch.