@@ -155,7 +155,7 @@ |
||
155 | 155 | { |
156 | 156 | $arguments = array_values($arguments); |
157 | 157 | array_unshift($arguments, null); |
158 | - unset($arguments[ 0 ]); |
|
158 | + unset($arguments[0]); |
|
159 | 159 | |
160 | 160 | $this->requestMethodArgs = $arguments; |
161 | 161 |
@@ -155,7 +155,7 @@ |
||
155 | 155 | { |
156 | 156 | $arguments = array_values($arguments); |
157 | 157 | array_unshift($arguments, null); |
158 | - unset($arguments[ 0 ]); |
|
158 | + unset($arguments[0]); |
|
159 | 159 | |
160 | 160 | $this->requestMethodArgs = $arguments; |
161 | 161 |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $this->path = $path; |
85 | 85 | $this->closure = $closure; |
86 | 86 | $this->domain = is_null($domain) |
87 | - ? isset($_SERVER[ 'HTTP_HOST' ]) |
|
88 | - ? @$_SERVER[ 'HTTP_HOST' ] |
|
89 | - : @$_SERVER[ 'SERVER_NAME' ] |
|
87 | + ? isset($_SERVER['HTTP_HOST']) |
|
88 | + ? @$_SERVER['HTTP_HOST'] |
|
89 | + : @$_SERVER['SERVER_NAME'] |
|
90 | 90 | : $domain; |
91 | 91 | |
92 | 92 | // Remove www |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | if (preg_match_all("/{(.*)}/", $this->domain, $matches)) { |
98 | - foreach ($matches[ 1 ] as $match) { |
|
98 | + foreach ($matches[1] as $match) { |
|
99 | 99 | $this->closureParameters[] = $match; |
100 | 100 | } |
101 | 101 | } |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function isValidDomain() |
204 | 204 | { |
205 | - $domain = isset($_SERVER[ 'HTTP_HOST' ]) |
|
206 | - ? $_SERVER[ 'HTTP_HOST' ] |
|
207 | - : $_SERVER[ 'SERVER_NAME' ]; |
|
205 | + $domain = isset($_SERVER['HTTP_HOST']) |
|
206 | + ? $_SERVER['HTTP_HOST'] |
|
207 | + : $_SERVER['SERVER_NAME']; |
|
208 | 208 | |
209 | 209 | if ($this->domain === $domain) { |
210 | 210 | return true; |
@@ -243,22 +243,22 @@ discard block |
||
243 | 243 | if (($class = $parameter->getClass()) instanceof \ReflectionClass) { |
244 | 244 | $className = $class->getName(); |
245 | 245 | if (class_exists($className)) { |
246 | - if (isset($matches[ $parameter->name ])) { |
|
247 | - $parameters[ $index ] = new $className($matches[ $parameter->name ]); |
|
246 | + if (isset($matches[$parameter->name])) { |
|
247 | + $parameters[$index] = new $className($matches[$parameter->name]); |
|
248 | 248 | } |
249 | 249 | } |
250 | - } elseif (isset($matches[ $parameter->name ])) { |
|
251 | - $parameters[ $index ] = $matches[ $parameter->name ]; |
|
250 | + } elseif (isset($matches[$parameter->name])) { |
|
251 | + $parameters[$index] = $matches[$parameter->name]; |
|
252 | 252 | } else { |
253 | - $parameters[ $index ] = null; |
|
253 | + $parameters[$index] = null; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 | } else { |
257 | 257 | foreach ($closure->getParameters() as $index => $parameter) { |
258 | - if (isset($matches[ $index ])) { |
|
259 | - $parameters[ $index ] = $matches[ $index ]; |
|
258 | + if (isset($matches[$index])) { |
|
259 | + $parameters[$index] = $matches[$index]; |
|
260 | 260 | } else { |
261 | - $parameters[ $index ] = null; |
|
261 | + $parameters[$index] = null; |
|
262 | 262 | } |
263 | 263 | } |
264 | 264 | } |
@@ -310,16 +310,16 @@ discard block |
||
310 | 310 | $parameters = []; |
311 | 311 | |
312 | 312 | for ($i = 0; $i <= count($pathParts); $i++) { |
313 | - if (isset($pathParts[ $i ]) && isset($stringParts[ $i ])) { |
|
314 | - if ($pathParts[ $i ] == $stringParts[ $i ]) { |
|
315 | - $matches[ $i ] = $stringParts[ $i ]; |
|
313 | + if (isset($pathParts[$i]) && isset($stringParts[$i])) { |
|
314 | + if ($pathParts[$i] == $stringParts[$i]) { |
|
315 | + $matches[$i] = $stringParts[$i]; |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | |
319 | - if (isset($pathParts[ $i ])) { |
|
320 | - if (preg_match("/{(.*)}/", $pathParts[ $i ])) { |
|
321 | - $index = str_replace(['{$', '}'], '', $pathParts[ $i ]); |
|
322 | - $parameters[ $index ] = isset($stringParts[ $i ]) ? $stringParts[ $i ] : null; |
|
319 | + if (isset($pathParts[$i])) { |
|
320 | + if (preg_match("/{(.*)}/", $pathParts[$i])) { |
|
321 | + $index = str_replace(['{$', '}'], '', $pathParts[$i]); |
|
322 | + $parameters[$index] = isset($stringParts[$i]) ? $stringParts[$i] : null; |
|
323 | 323 | } |
324 | 324 | } |
325 | 325 | } |