Passed
Branch dev (473855)
by Alex
02:25
created
src/Collectors/ResourceCollectorTrait.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,8 +76,9 @@
 block discarded – undo
76 76
     public function resources(array $controllers)
77 77
     {
78 78
         $resource = new Resource;
79
-        foreach ($controllers as $controller)
80
-            $resource->set($this->resource($controller));
79
+        foreach ($controllers as $controller) {
80
+                    $resource->set($this->resource($controller));
81
+        }
81 82
         return $resource;
82 83
     }
83 84
 
Please login to merge, or discard this patch.
src/Resource.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -173,7 +173,9 @@
 block discarded – undo
173 173
         foreach ($segments as $index => $segment) {
174 174
             if (strpos($segment, "{") === 0) {
175 175
                    $pattern .= "/{" . $segments[$index - 1] . "_" . ltrim($segment, "{");
176
-            } else $pattern .= $segment;
176
+            } else {
177
+            	$pattern .= $segment;
178
+            }
177 179
         }
178 180
 
179 181
         return $pattern;
Please login to merge, or discard this patch.
src/Strategies/EnhancerAbstractStrategy.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,9 @@
 block discarded – undo
41 41
     {
42 42
         if ($route->hasMetadata($this->metadataStrategyKey)) {
43 43
                $route->setStrategy($route->getMetadata($this->metadataStrategyKey));
44
-        } else $route->setStrategy(null);
44
+        } else {
45
+        	$route->setStrategy(null);
46
+        }
45 47
 
46 48
         $this->enhance($route);
47 49
 
Please login to merge, or discard this patch.
src/Route.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,7 +212,9 @@  discard block
 block discarded – undo
212 212
             if (is_string($callable[0])) {
213 213
                    $callable[0] = $this->parseCallableController($callable[0]);
214 214
                    $callable[1] = $this->parseCallablePlaceholders($callable[1]);
215
-            } else $callable[1] = $this->parseCallablePlaceholders($callable[1]);
215
+            } else {
216
+            	$callable[1] = $this->parseCallablePlaceholders($callable[1]);
217
+            }
216 218
         }
217 219
 
218 220
         return $callable;
@@ -231,7 +233,9 @@  discard block
 block discarded – undo
231 233
 
232 234
         if ($this->controllerCreationFunction === null) {
233 235
                return new $controller;
234
-        } else return call_user_func($this->controllerCreationFunction, $controller);
236
+        } else {
237
+        	return call_user_func($this->controllerCreationFunction, $controller);
238
+        }
235 239
     }
236 240
 
237 241
     /**
Please login to merge, or discard this patch.
src/Collector.php 1 patch
Braces   +21 added lines, -11 removed lines patch added patch discarded remove patch
@@ -117,7 +117,9 @@  discard block
 block discarded – undo
117 117
             if (strpos($pattern, "{") !== false) {
118 118
                    $index = $this->getDynamicIndex($method, $pattern);
119 119
                    $this->dynamics[$index][$pattern] = $route;
120
-            } else $this->statics[$method][$pattern] = $route;
120
+            } else {
121
+            	$this->statics[$method][$pattern] = $route;
122
+            }
121 123
         }
122 124
 
123 125
         return $group;
@@ -142,8 +144,9 @@  discard block
 block discarded – undo
142 144
     public function match(array $methods, $pattern, $action)
143 145
     {
144 146
         $group = new Group;
145
-        foreach ($methods as $method)
146
-            $group->set($this->set($method, $pattern, $action));
147
+        foreach ($methods as $method) {
148
+                    $group->set($this->set($method, $pattern, $action));
149
+        }
147 150
         return $group;
148 151
     }
149 152
 
@@ -186,8 +189,9 @@  discard block
 block discarded – undo
186 189
     public function group(array $routes)
187 190
     {
188 191
         $group = new Group;
189
-        foreach ($routes as $route)
190
-            $group->set($route);
192
+        foreach ($routes as $route) {
193
+                    $group->set($route);
194
+        }
191 195
         return $group;
192 196
     }
193 197
 
@@ -202,7 +206,9 @@  discard block
 block discarded – undo
202 206
     {
203 207
         if (strpos($pattern, "{") === false) {
204 208
                unset($this->statics[$method][$pattern]);
205
-        } else unset($this->dynamics[$this->getDynamicIndex($method, $pattern)][$pattern]);
209
+        } else {
210
+        	unset($this->dynamics[$this->getDynamicIndex($method, $pattern)][$pattern]);
211
+        }
206 212
     }
207 213
 
208 214
     /**
@@ -257,7 +263,9 @@  discard block
 block discarded – undo
257 263
         if ($closingNumber !== count($segments) - 1) {
258 264
             if (preg_match("~" . self::DYNAMIC_REGEX . "(*SKIP)(*F)|\]~x", $withoutClosing)) {
259 265
                    throw new BadRouteException(BadRouteException::OPTIONAL_SEGMENTS_ON_MIDDLE);
260
-            } else throw new BadRouteException(BadRouteException::UNCLOSED_OPTIONAL_SEGMENTS);
266
+            } else {
267
+            	throw new BadRouteException(BadRouteException::UNCLOSED_OPTIONAL_SEGMENTS);
268
+            }
261 269
         }
262 270
     }
263 271
 
@@ -296,8 +304,9 @@  discard block
 block discarded – undo
296 304
     public function findStaticRoute($method, $pattern)
297 305
     {
298 306
         $method = strtolower($method);
299
-        if (isset($this->statics[$method]) && isset($this->statics[$method][$pattern]))
300
-            return $this->statics[$method][$pattern];
307
+        if (isset($this->statics[$method]) && isset($this->statics[$method][$pattern])) {
308
+                    return $this->statics[$method][$pattern];
309
+        }
301 310
         return false;
302 311
     }
303 312
 
@@ -333,8 +342,9 @@  discard block
 block discarded – undo
333 342
     public function getWildcards()
334 343
     {
335 344
         $wildcards = [];
336
-        foreach ($this->wildcards as $token => $regex)
337
-            $wildcards[substr($token, 1)] = substr($regex, 1);
345
+        foreach ($this->wildcards as $token => $regex) {
346
+                    $wildcards[substr($token, 1)] = substr($regex, 1);
347
+        }
338 348
         return $wildcards;
339 349
     }
340 350
 
Please login to merge, or discard this patch.
src/Collectors/ControllerCollectorTrait.php 1 patch
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,8 +69,9 @@  discard block
 block discarded – undo
69 69
     public function controllers(array $controllers)
70 70
     {
71 71
         $group = new Group;
72
-        foreach ($controllers as $controller)
73
-            $group->set($this->controller($controller));
72
+        foreach ($controllers as $controller) {
73
+                    $group->set($this->controller($controller));
74
+        }
74 75
         return $group;
75 76
     }
76 77
 
@@ -100,8 +101,9 @@  discard block
 block discarded – undo
100 101
     public function controllersWithoutPrefix(array $controllers)
101 102
     {
102 103
         $group = new Group;
103
-        foreach ($controllers as $controller)
104
-            $group->set($this->controllerWithoutPrefix($controller));
104
+        foreach ($controllers as $controller) {
105
+                    $group->set($this->controllerWithoutPrefix($controller));
106
+        }
105 107
         return $group;
106 108
     }
107 109
 
@@ -134,7 +136,9 @@  discard block
 block discarded – undo
134 136
 
135 137
                 if ($strategy !== null) {
136 138
                        $route->setStrategy($strategy);
137
-                } else $route->setStrategy($controllerDefaultStrategy);
139
+                } else {
140
+                	$route->setStrategy($controllerDefaultStrategy);
141
+                }
138 142
 
139 143
                 $group->set($route);
140 144
             }
Please login to merge, or discard this patch.
src/Group.php 1 patch
Braces   +39 added lines, -25 removed lines patch added patch discarded remove patch
@@ -37,9 +37,12 @@  discard block
 block discarded – undo
37 37
     public function set($route)
38 38
     {
39 39
         if ($route instanceof Group) {
40
-            foreach ($route->all() as $r)
41
-                $this->routes[] = $r;
42
-        } else  $this->routes[] = $route;
40
+            foreach ($route->all() as $r) {
41
+                            $this->routes[] = $r;
42
+            }
43
+        } else {
44
+        	$this->routes[] = $route;
45
+        }
43 46
         return  $this;
44 47
     }
45 48
 
@@ -88,8 +91,9 @@  discard block
 block discarded – undo
88 91
 
89 92
     public function forget()
90 93
     {
91
-        foreach ($this->routes as $route)
92
-            $route->forget();
94
+        foreach ($this->routes as $route) {
95
+                    $route->forget();
96
+        }
93 97
         return $this;
94 98
     }
95 99
 
@@ -102,8 +106,9 @@  discard block
 block discarded – undo
102 106
 
103 107
     public function setMethod($method)
104 108
     {
105
-        foreach ($this->routes as $route)
106
-            $route->setMethod($method);
109
+        foreach ($this->routes as $route) {
110
+                    $route->setMethod($method);
111
+        }
107 112
         return $this;
108 113
     }
109 114
 
@@ -116,8 +121,9 @@  discard block
 block discarded – undo
116 121
 
117 122
     public function setAction($action)
118 123
     {
119
-        foreach ($this->routes as $route)
120
-            $route->setAction($action);
124
+        foreach ($this->routes as $route) {
125
+                    $route->setAction($action);
126
+        }
121 127
         return $this;
122 128
     }
123 129
 
@@ -130,8 +136,9 @@  discard block
 block discarded – undo
130 136
 
131 137
     public function setNamespace($namespace)
132 138
     {
133
-        foreach ($this->routes as $route)
134
-            $route->setNamespace($namespace);
139
+        foreach ($this->routes as $route) {
140
+                    $route->setNamespace($namespace);
141
+        }
135 142
         return $this;
136 143
     }
137 144
 
@@ -145,8 +152,9 @@  discard block
 block discarded – undo
145 152
     public function setPrefix($prefix)
146 153
     {
147 154
         $prefix = "/" . ltrim($prefix, "/");
148
-        foreach ($this->routes as $route)
149
-            $route->setPattern(rtrim($prefix . $route->getPattern(), "/"));
155
+        foreach ($this->routes as $route) {
156
+                    $route->setPattern(rtrim($prefix . $route->getPattern(), "/"));
157
+        }
150 158
         return $this;
151 159
     }
152 160
 
@@ -161,8 +169,9 @@  discard block
 block discarded – undo
161 169
 
162 170
     public function setMetadata($key, $value)
163 171
     {
164
-        foreach ($this->routes as $route)
165
-            $route->setMetadata($key, $value);
172
+        foreach ($this->routes as $route) {
173
+                    $route->setMetadata($key, $value);
174
+        }
166 175
         return $this;
167 176
     }
168 177
 
@@ -175,8 +184,9 @@  discard block
 block discarded – undo
175 184
 
176 185
     public function setMetadataArray(array $metadata)
177 186
     {
178
-        foreach ($this->routes as $route)
179
-            $route->setMetadataArray($metadata);
187
+        foreach ($this->routes as $route) {
188
+                    $route->setMetadataArray($metadata);
189
+        }
180 190
         return $this;
181 191
     }
182 192
 
@@ -189,8 +199,9 @@  discard block
 block discarded – undo
189 199
 
190 200
     public function setDefaults(array $defaults)
191 201
     {
192
-        foreach ($this->routes as $route)
193
-            $route->setDefaults($defaults);
202
+        foreach ($this->routes as $route) {
203
+                    $route->setDefaults($defaults);
204
+        }
194 205
         return $this;
195 206
     }
196 207
 
@@ -205,8 +216,9 @@  discard block
 block discarded – undo
205 216
 
206 217
     public function setDefault($key, $value)
207 218
     {
208
-        foreach ($this->routes as $route)
209
-            $route->setDefault($key, $value);
219
+        foreach ($this->routes as $route) {
220
+                    $route->setDefault($key, $value);
221
+        }
210 222
         return $this;
211 223
     }
212 224
 
@@ -219,8 +231,9 @@  discard block
 block discarded – undo
219 231
 
220 232
     public function setStrategy($strategy)
221 233
     {
222
-        foreach ($this->routes as $route)
223
-            $route->setStrategy($strategy);
234
+        foreach ($this->routes as $route) {
235
+                    $route->setStrategy($strategy);
236
+        }
224 237
         return $this;
225 238
     }
226 239
 
@@ -235,8 +248,9 @@  discard block
 block discarded – undo
235 248
 
236 249
     public function setConstraint($name, $regex)
237 250
     {
238
-        foreach ($this->routes as $route)
239
-            $route->setConstraint($name, $regex);
251
+        foreach ($this->routes as $route) {
252
+                    $route->setConstraint($name, $regex);
253
+        }
240 254
         return $this;
241 255
     }
242 256
 
Please login to merge, or discard this patch.