@@ -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,28 +136,28 @@ discard block |
||
| 136 | 136 | $this->paramRoutes[$requestMethod][] = [ |
| 137 | 137 | 'bunch' => [] |
| 138 | 138 | ]; |
| 139 | - $bunchCursor ++; |
|
| 139 | + $bunchCursor++; |
|
| 140 | 140 | $lastBunchSize = 0; |
| 141 | 141 | } |
| 142 | 142 | preg_match_all('#\[(.*?)\]#', $route, $match); |
| 143 | - foreach ( $match[0] as $key =>$block ) { |
|
| 144 | - $role = explode ( ":",$match[1][$key]); |
|
| 145 | - switch($role[0]) { |
|
| 143 | + foreach ($match[0] as $key =>$block) { |
|
| 144 | + $role = explode(":", $match[1][$key]); |
|
| 145 | + switch ($role[0]) { |
|
| 146 | 146 | case "s": // any string |
| 147 | 147 | $regex = "[a-zA-Z0-9]+$"; |
| 148 | - $route = str_replace($match[0][$key],$regex,$route); |
|
| 148 | + $route = str_replace($match[0][$key], $regex, $route); |
|
| 149 | 149 | break; |
| 150 | 150 | case "i": // any integer number |
| 151 | 151 | $regex = "[0-9]+$"; |
| 152 | - $route = str_replace($match[0][$key],$regex,$route); |
|
| 152 | + $route = str_replace($match[0][$key], $regex, $route); |
|
| 153 | 153 | break; |
| 154 | 154 | case "a": // any string |
| 155 | 155 | $regex = "([^\s]+)"; |
| 156 | - $route = str_replace($match[0][$key],$regex,$route); |
|
| 156 | + $route = str_replace($match[0][$key], $regex, $route); |
|
| 157 | 157 | break; |
| 158 | 158 | case "il": // comma separated list of integer ids |
| 159 | 159 | $regex = "[0-9]+(,[0-9]+)*"; |
| 160 | - $route = str_replace($match[0][$key],$regex,$route); |
|
| 160 | + $route = str_replace($match[0][$key], $regex, $route); |
|
| 161 | 161 | break; |
| 162 | 162 | } |
| 163 | 163 | } |
@@ -290,11 +290,11 @@ discard block |
||
| 290 | 290 | |
| 291 | 291 | foreach (self::getListOfSupportedRequestMethods() as $requestMethod) { |
| 292 | 292 | $trace[] = $requestMethod . ' : '; |
| 293 | - if (! empty($this->staticRoutes[$requestMethod])) { |
|
| 293 | + if (!empty($this->staticRoutes[$requestMethod])) { |
|
| 294 | 294 | $trace[] = implode(', ', array_keys($this->staticRoutes[$requestMethod])); |
| 295 | 295 | $trace[] = ', '; |
| 296 | 296 | } |
| 297 | - if (! empty($this->paramRoutes[$requestMethod])) { |
|
| 297 | + if (!empty($this->paramRoutes[$requestMethod])) { |
|
| 298 | 298 | foreach ($this->paramRoutes[$requestMethod] as $bunch) { |
| 299 | 299 | $items = []; |
| 300 | 300 | foreach ($bunch['bunch'] as $item) { |