@@ -35,8 +35,8 @@ |
||
| 35 | 35 | { |
| 36 | 36 | // setup |
| 37 | 37 | $router = new Router(); |
| 38 | - for ($i = 1; $i <= $amount; $i ++) { |
|
| 39 | - $router->addRoute('/param/[i:id]/' . $i, function () use ($i): int { |
|
| 38 | + for ($i = 1; $i <= $amount; $i++) { |
|
| 39 | + $router->addRoute('/param/[i:id]/' . $i, function() use ($i): int { |
|
| 40 | 40 | return $i; |
| 41 | 41 | }); |
| 42 | 42 | } |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | { |
| 259 | 259 | $routerTrimmed = trim($router, '/'); |
| 260 | 260 | |
| 261 | - if (! isset($this->middleware[$routerTrimmed])) { |
|
| 261 | + if (!isset($this->middleware[$routerTrimmed])) { |
|
| 262 | 262 | $this->middleware[$routerTrimmed] = []; |
| 263 | 263 | } |
| 264 | 264 | |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | $this->parameters |
| 290 | 290 | ]; |
| 291 | 291 | |
| 292 | - if (! count($middleWares)) { |
|
| 292 | + if (!count($middleWares)) { |
|
| 293 | 293 | return $result; |
| 294 | 294 | } |
| 295 | 295 | |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | */ |
| 108 | 108 | public function callRoute($route) |
| 109 | 109 | { |
| 110 | - if (! $this->regExpsWereCompiled) { |
|
| 110 | + if (!$this->regExpsWereCompiled) { |
|
| 111 | 111 | $this->compileRegexpForBunches(); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | { |
| 51 | 51 | $return = ''; |
| 52 | 52 | |
| 53 | - for ($n = 0; $n <= $i; $n ++) { |
|
| 53 | + for ($n = 0; $n <= $i; $n++) { |
|
| 54 | 54 | $return .= '()'; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | protected function compileRegexpForBunch(array &$bunch): void |
| 66 | 66 | { |
| 67 | - if (! empty($bunch['bunch'])) { |
|
| 67 | + if (!empty($bunch['bunch'])) { |
|
| 68 | 68 | $bunch['regexp'] = ''; |
| 69 | 69 | $hashTable = []; |
| 70 | 70 | $items = []; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | protected function compileRegexpForBunches(): void |
| 102 | 102 | { |
| 103 | - if (! $this->regExpsWereCompiled) { |
|
| 103 | + if (!$this->regExpsWereCompiled) { |
|
| 104 | 104 | foreach (self::getListOfSupportedRequestMethods() as $requestMethod) { |
| 105 | 105 | foreach ($this->paramRoutes[$requestMethod] as &$bunch) { |
| 106 | 106 | $this->compileRegexpForBunch($bunch); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $this->paramRoutes[$requestMethod][] = [ |
| 137 | 137 | 'bunch' => [] |
| 138 | 138 | ]; |
| 139 | - $bunchCursor ++; |
|
| 139 | + $bunchCursor++; |
|
| 140 | 140 | $lastBunchSize = 0; |
| 141 | 141 | } |
| 142 | 142 | |
@@ -268,11 +268,11 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | foreach (self::getListOfSupportedRequestMethods() as $requestMethod) { |
| 270 | 270 | $trace[] = $requestMethod . ' : '; |
| 271 | - if (! empty($this->staticRoutes[$requestMethod])) { |
|
| 271 | + if (!empty($this->staticRoutes[$requestMethod])) { |
|
| 272 | 272 | $trace[] = implode(', ', array_keys($this->staticRoutes[$requestMethod])); |
| 273 | 273 | $trace[] = ', '; |
| 274 | 274 | } |
| 275 | - if (! empty($this->paramRoutes[$requestMethod])) { |
|
| 275 | + if (!empty($this->paramRoutes[$requestMethod])) { |
|
| 276 | 276 | foreach ($this->paramRoutes[$requestMethod] as $bunch) { |
| 277 | 277 | $items = []; |
| 278 | 278 | foreach ($bunch['bunch'] as $item) { |