@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | return $this->dispatcher; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | - $routeDefinitionCallback = function (RouteCollector $r) { |
|
| 227 | + $routeDefinitionCallback = function(RouteCollector $r) { |
|
| 228 | 228 | foreach ($this->getRoutes() as $route) { |
| 229 | 229 | $r->addRoute($route->getMethods(), $route->getPattern(), $route->getIdentifier()); |
| 230 | 230 | } |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | } |
| 383 | 383 | $url = implode('', $segments); |
| 384 | 384 | |
| 385 | - $hasQueryParams = array_filter($queryParams, function ($value) { |
|
| 385 | + $hasQueryParams = array_filter($queryParams, function($value) { |
|
| 386 | 386 | return $value !== null; |
| 387 | 387 | }) !== []; |
| 388 | 388 | |
@@ -183,23 +183,23 @@ discard block |
||
| 183 | 183 | $host = $matches[1]; |
| 184 | 184 | |
| 185 | 185 | if (isset($matches[2])) { |
| 186 | - $port = (int) substr($matches[2], 1); |
|
| 186 | + $port = (int)substr($matches[2], 1); |
|
| 187 | 187 | } |
| 188 | 188 | } else { |
| 189 | 189 | $pos = strpos($host, ':'); |
| 190 | 190 | if ($pos !== false) { |
| 191 | - $port = (int) substr($host, $pos + 1); |
|
| 191 | + $port = (int)substr($host, $pos + 1); |
|
| 192 | 192 | $host = strstr($host, ':', true); |
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | // Path |
| 197 | - $requestScriptName = (string) parse_url($env->get('SCRIPT_NAME'), PHP_URL_PATH); |
|
| 197 | + $requestScriptName = (string)parse_url($env->get('SCRIPT_NAME'), PHP_URL_PATH); |
|
| 198 | 198 | $requestScriptDir = dirname($requestScriptName); |
| 199 | 199 | |
| 200 | 200 | // parse_url() requires a full URL. As we don't extract the domain name or scheme, |
| 201 | 201 | // we use a stand-in. |
| 202 | - $requestUri = (string) parse_url('http://example.com' . $env->get('REQUEST_URI'), PHP_URL_PATH); |
|
| 202 | + $requestUri = (string)parse_url('http://example.com' . $env->get('REQUEST_URI'), PHP_URL_PATH); |
|
| 203 | 203 | |
| 204 | 204 | $basePath = ''; |
| 205 | 205 | $virtualPath = $requestUri; |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | { |
| 394 | 394 | return preg_replace_callback( |
| 395 | 395 | '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u', |
| 396 | - function ($match) { |
|
| 396 | + function($match) { |
|
| 397 | 397 | return rawurlencode($match[0]); |
| 398 | 398 | }, |
| 399 | 399 | $query |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | { |
| 643 | 643 | return preg_replace_callback( |
| 644 | 644 | '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', |
| 645 | - function ($match) { |
|
| 645 | + function($match) { |
|
| 646 | 646 | return rawurlencode($match[0]); |
| 647 | 647 | }, |
| 648 | 648 | $path |
@@ -715,7 +715,7 @@ discard block |
||
| 715 | 715 | { |
| 716 | 716 | return preg_replace_callback( |
| 717 | 717 | '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', |
| 718 | - function ($match) { |
|
| 718 | + function($match) { |
|
| 719 | 719 | return rawurlencode($match[0]); |
| 720 | 720 | }, |
| 721 | 721 | $query |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $this->headers->set('Host', $this->uri->getHost() . $port); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - $this->registerMediaTypeParser('application/json', function ($input) { |
|
| 199 | + $this->registerMediaTypeParser('application/json', function($input) { |
|
| 200 | 200 | $result = json_decode($input, true); |
| 201 | 201 | if (!is_array($result)) { |
| 202 | 202 | return null; |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | return $result; |
| 205 | 205 | }); |
| 206 | 206 | |
| 207 | - $this->registerMediaTypeParser('application/xml', function ($input) { |
|
| 207 | + $this->registerMediaTypeParser('application/xml', function($input) { |
|
| 208 | 208 | $backup = self::disableXmlEntityLoader(true); |
| 209 | 209 | $backup_errors = libxml_use_internal_errors(true); |
| 210 | 210 | $result = simplexml_load_string($input); |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | return $result; |
| 218 | 218 | }); |
| 219 | 219 | |
| 220 | - $this->registerMediaTypeParser('text/xml', function ($input) { |
|
| 220 | + $this->registerMediaTypeParser('text/xml', function($input) { |
|
| 221 | 221 | $backup = self::disableXmlEntityLoader(true); |
| 222 | 222 | $backup_errors = libxml_use_internal_errors(true); |
| 223 | 223 | $result = simplexml_load_string($input); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | return $result; |
| 231 | 231 | }); |
| 232 | 232 | |
| 233 | - $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { |
|
| 233 | + $this->registerMediaTypeParser('application/x-www-form-urlencoded', function($input) { |
|
| 234 | 234 | parse_str($input, $data); |
| 235 | 235 | return $data; |
| 236 | 236 | }); |
@@ -1018,7 +1018,7 @@ discard block |
||
| 1018 | 1018 | // If not, look for a media type with a structured syntax suffix (RFC 6839) |
| 1019 | 1019 | $parts = explode('+', $mediaType); |
| 1020 | 1020 | if (count($parts) >= 2) { |
| 1021 | - $mediaType = 'application/' . $parts[count($parts)-1]; |
|
| 1021 | + $mediaType = 'application/' . $parts[count($parts) - 1]; |
|
| 1022 | 1022 | } |
| 1023 | 1023 | } |
| 1024 | 1024 | |