@@ -117,7 +117,7 @@ |
||
| 117 | 117 | /** |
| 118 | 118 | * Render exception or error as HTML. |
| 119 | 119 | * |
| 120 | - * @param \Exception|\Error $exception |
|
| 120 | + * @param \Exception $exception |
|
| 121 | 121 | * |
| 122 | 122 | * @return string |
| 123 | 123 | */ |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $this->seedMiddlewareStack(); |
| 61 | 61 | } |
| 62 | 62 | $next = $this->tip; |
| 63 | - $this->tip = function ( |
|
| 63 | + $this->tip = function( |
|
| 64 | 64 | ServerRequestInterface $request, |
| 65 | 65 | ResponseInterface $response |
| 66 | 66 | ) use ( |
@@ -186,12 +186,12 @@ discard block |
||
| 186 | 186 | $host = $matches[1]; |
| 187 | 187 | |
| 188 | 188 | if (isset($matches[2])) { |
| 189 | - $port = (int) substr($matches[2], 1); |
|
| 189 | + $port = (int)substr($matches[2], 1); |
|
| 190 | 190 | } |
| 191 | 191 | } else { |
| 192 | 192 | $pos = strpos($host, ':'); |
| 193 | 193 | if ($pos !== false) { |
| 194 | - $port = (int) substr($host, $pos + 1); |
|
| 194 | + $port = (int)substr($host, $pos + 1); |
|
| 195 | 195 | $host = strstr($host, ':', true); |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | { |
| 397 | 397 | return preg_replace_callback( |
| 398 | 398 | '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=]+|%(?![A-Fa-f0-9]{2}))/u', |
| 399 | - function ($match) { |
|
| 399 | + function($match) { |
|
| 400 | 400 | return rawurlencode($match[0]); |
| 401 | 401 | }, |
| 402 | 402 | $query |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | { |
| 642 | 642 | return preg_replace_callback( |
| 643 | 643 | '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', |
| 644 | - function ($match) { |
|
| 644 | + function($match) { |
|
| 645 | 645 | return rawurlencode($match[0]); |
| 646 | 646 | }, |
| 647 | 647 | $path |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | { |
| 715 | 715 | return preg_replace_callback( |
| 716 | 716 | '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', |
| 717 | - function ($match) { |
|
| 717 | + function($match) { |
|
| 718 | 718 | return rawurlencode($match[0]); |
| 719 | 719 | }, |
| 720 | 720 | $query |
@@ -222,8 +222,8 @@ |
||
| 222 | 222 | protected function filterStatus($status) |
| 223 | 223 | { |
| 224 | 224 | if (!is_integer($status) || |
| 225 | - $status<StatusCode::HTTP_CONTINUE || |
|
| 226 | - $status>StatusCode::HTTP_NETWORK_CONNECTION_TIMEOUT_ERROR |
|
| 225 | + $status < StatusCode::HTTP_CONTINUE || |
|
| 226 | + $status > StatusCode::HTTP_NETWORK_CONNECTION_TIMEOUT_ERROR |
|
| 227 | 227 | ) { |
| 228 | 228 | throw new InvalidArgumentException('Invalid HTTP status code'); |
| 229 | 229 | } |
@@ -31,12 +31,12 @@ |
||
| 31 | 31 | const HTTP_SEE_OTHER = 303; |
| 32 | 32 | const HTTP_NOT_MODIFIED = 304; |
| 33 | 33 | const HTTP_USE_PROXY = 305; |
| 34 | - const HTTP_UNUSED= 306; |
|
| 34 | + const HTTP_UNUSED = 306; |
|
| 35 | 35 | const HTTP_TEMPORARY_REDIRECT = 307; |
| 36 | 36 | const HTTP_PERMANENT_REDIRECT = 308; |
| 37 | 37 | |
| 38 | 38 | const HTTP_BAD_REQUEST = 400; |
| 39 | - const HTTP_UNAUTHORIZED = 401; |
|
| 39 | + const HTTP_UNAUTHORIZED = 401; |
|
| 40 | 40 | const HTTP_PAYMENT_REQUIRED = 402; |
| 41 | 41 | const HTTP_FORBIDDEN = 403; |
| 42 | 42 | const HTTP_NOT_FOUND = 404; |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | { |
| 86 | 86 | if (is_array($env['slim.files']) && $env->has('slim.files')) { |
| 87 | 87 | return $env['slim.files']; |
| 88 | - } elseif (! empty($_FILES)) { |
|
| 88 | + } elseif (!empty($_FILES)) { |
|
| 89 | 89 | return static::parseUploadedFiles($_FILES); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return EnvironmentInterface |
| 46 | 46 | */ |
| 47 | - $container['environment'] = function () { |
|
| 47 | + $container['environment'] = function() { |
|
| 48 | 48 | return new Environment($_SERVER); |
| 49 | 49 | }; |
| 50 | 50 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return ServerRequestInterface |
| 59 | 59 | */ |
| 60 | - $container['request'] = function ($container) { |
|
| 60 | + $container['request'] = function($container) { |
|
| 61 | 61 | return Request::createFromEnvironment($container->get('environment')); |
| 62 | 62 | }; |
| 63 | 63 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return ResponseInterface |
| 72 | 72 | */ |
| 73 | - $container['response'] = function ($container) { |
|
| 73 | + $container['response'] = function($container) { |
|
| 74 | 74 | $headers = new Headers(['Content-Type' => 'text/html; charset=UTF-8']); |
| 75 | 75 | $response = new Response(200, $headers); |
| 76 | 76 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | if (!isset($container['routeParser'])) { |
| 82 | - $container['routeParser'] = function () { |
|
| 82 | + $container['routeParser'] = function() { |
|
| 83 | 83 | return new StdParser; |
| 84 | 84 | }; |
| 85 | 85 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * |
| 94 | 94 | * @return RouterInterface |
| 95 | 95 | */ |
| 96 | - $container['router'] = function ($container) { |
|
| 96 | + $container['router'] = function($container) { |
|
| 97 | 97 | $routerCacheFile = false; |
| 98 | 98 | if (isset($container->get('settings')['routerCacheFile'])) { |
| 99 | 99 | $routerCacheFile = $container->get('settings')['routerCacheFile']; |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | * |
| 117 | 117 | * @return InvocationStrategyInterface |
| 118 | 118 | */ |
| 119 | - $container['foundHandler'] = function () { |
|
| 119 | + $container['foundHandler'] = function() { |
|
| 120 | 120 | return new RequestResponse; |
| 121 | 121 | }; |
| 122 | 122 | } |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * |
| 138 | 138 | * @return callable |
| 139 | 139 | */ |
| 140 | - $container['phpErrorHandler'] = function ($container) { |
|
| 140 | + $container['phpErrorHandler'] = function($container) { |
|
| 141 | 141 | return new PhpError($container->get('settings')['displayErrorDetails']); |
| 142 | 142 | }; |
| 143 | 143 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * |
| 159 | 159 | * @return callable |
| 160 | 160 | */ |
| 161 | - $container['errorHandler'] = function ($container) { |
|
| 161 | + $container['errorHandler'] = function($container) { |
|
| 162 | 162 | return new Error( |
| 163 | 163 | $container->get('settings')['displayErrorDetails'] |
| 164 | 164 | ); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | * |
| 179 | 179 | * @return callable |
| 180 | 180 | */ |
| 181 | - $container['notFoundHandler'] = function () { |
|
| 181 | + $container['notFoundHandler'] = function() { |
|
| 182 | 182 | return new NotFound; |
| 183 | 183 | }; |
| 184 | 184 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * |
| 198 | 198 | * @return callable |
| 199 | 199 | */ |
| 200 | - $container['notAllowedHandler'] = function () { |
|
| 200 | + $container['notAllowedHandler'] = function() { |
|
| 201 | 201 | return new NotAllowed; |
| 202 | 202 | }; |
| 203 | 203 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * |
| 211 | 211 | * @return CallableResolverInterface |
| 212 | 212 | */ |
| 213 | - $container['callableResolver'] = function ($container) { |
|
| 213 | + $container['callableResolver'] = function($container) { |
|
| 214 | 214 | return new CallableResolver($container); |
| 215 | 215 | }; |
| 216 | 216 | } |