@@ -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 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * |
43 | 43 | * @return Environment |
44 | 44 | */ |
45 | - $container['environment'] = function () { |
|
45 | + $container['environment'] = function() { |
|
46 | 46 | return new Environment($_SERVER); |
47 | 47 | }; |
48 | 48 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * |
56 | 56 | * @return ServerRequestInterface |
57 | 57 | */ |
58 | - $container['request'] = function ($container) { |
|
58 | + $container['request'] = function($container) { |
|
59 | 59 | return Request::createFromEnvironment($container->get('environment')); |
60 | 60 | }; |
61 | 61 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * |
69 | 69 | * @return ResponseInterface |
70 | 70 | */ |
71 | - $container['response'] = function ($container) { |
|
71 | + $container['response'] = function($container) { |
|
72 | 72 | $headers = new Headers(['Content-Type' => 'text/html; charset=UTF-8']); |
73 | 73 | $response = new Response(200, $headers); |
74 | 74 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return RouterInterface |
87 | 87 | */ |
88 | - $container['router'] = function ($container) { |
|
88 | + $container['router'] = function($container) { |
|
89 | 89 | $routerCacheFile = false; |
90 | 90 | if (isset($container->get('settings')['routerCacheFile'])) { |
91 | 91 | $routerCacheFile = $container->get('settings')['routerCacheFile']; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @return InvocationStrategyInterface |
110 | 110 | */ |
111 | - $container['foundHandler'] = function () { |
|
111 | + $container['foundHandler'] = function() { |
|
112 | 112 | return new RequestResponse; |
113 | 113 | }; |
114 | 114 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * |
130 | 130 | * @return callable |
131 | 131 | */ |
132 | - $container['phpErrorHandler'] = function ($container) { |
|
132 | + $container['phpErrorHandler'] = function($container) { |
|
133 | 133 | return new PhpError($container->get('settings')['displayErrorDetails']); |
134 | 134 | }; |
135 | 135 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * |
151 | 151 | * @return callable |
152 | 152 | */ |
153 | - $container['errorHandler'] = function ($container) { |
|
153 | + $container['errorHandler'] = function($container) { |
|
154 | 154 | return new Error( |
155 | 155 | $container->get('settings')['displayErrorDetails'] |
156 | 156 | ); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * |
171 | 171 | * @return callable |
172 | 172 | */ |
173 | - $container['notFoundHandler'] = function () { |
|
173 | + $container['notFoundHandler'] = function() { |
|
174 | 174 | return new NotFound; |
175 | 175 | }; |
176 | 176 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @return callable |
191 | 191 | */ |
192 | - $container['notAllowedHandler'] = function () { |
|
192 | + $container['notAllowedHandler'] = function() { |
|
193 | 193 | return new NotAllowed; |
194 | 194 | }; |
195 | 195 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * |
203 | 203 | * @return CallableResolverInterface |
204 | 204 | */ |
205 | - $container['callableResolver'] = function ($container) { |
|
205 | + $container['callableResolver'] = function($container) { |
|
206 | 206 | return new CallableResolver($container); |
207 | 207 | }; |
208 | 208 | } |
@@ -79,7 +79,7 @@ |
||
79 | 79 | * |
80 | 80 | * @return array|ArrayAccess |
81 | 81 | */ |
82 | - $this['settings'] = function () use ($userSettings, $defaultSettings) { |
|
82 | + $this['settings'] = function() use ($userSettings, $defaultSettings) { |
|
83 | 83 | return new Collection(array_merge($defaultSettings, $userSettings)); |
84 | 84 | }; |
85 | 85 |
@@ -111,7 +111,7 @@ |
||
111 | 111 | /** |
112 | 112 | * Render exception or error as HTML. |
113 | 113 | * |
114 | - * @param Exception|\Error $exception |
|
114 | + * @param Exception $exception |
|
115 | 115 | * |
116 | 116 | * @return string |
117 | 117 | * |
@@ -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 |
@@ -73,7 +73,7 @@ |
||
73 | 73 | protected $savedArguments = []; |
74 | 74 | |
75 | 75 | /** |
76 | - * @param string|string[] $methods The route HTTP methods |
|
76 | + * @param string[] $methods The route HTTP methods |
|
77 | 77 | * @param string $pattern The route pattern |
78 | 78 | * @param callable $callable The route callable |
79 | 79 | * @param RouteGroup[] $groups The parent route groups |