@@ -72,7 +72,7 @@ |
||
72 | 72 | /** |
73 | 73 | * Create new route |
74 | 74 | * |
75 | - * @param string|string[] $methods The route HTTP methods |
|
75 | + * @param string[] $methods The route HTTP methods |
|
76 | 76 | * @param string $pattern The route pattern |
77 | 77 | * @param callable $callable The route callable |
78 | 78 | * @param RouteGroup[] $groups The parent route groups |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use InvalidArgumentException; |
13 | 13 | use Psr\Http\Message\ServerRequestInterface; |
14 | 14 | use Psr\Http\Message\ResponseInterface; |
15 | -use Slim\Exception\SlimException; |
|
16 | 15 | use Slim\Handlers\Strategies\RequestResponse; |
17 | 16 | use Slim\Interfaces\InvocationStrategyInterface; |
18 | 17 | use Slim\Interfaces\RouteInterface; |
@@ -801,7 +801,7 @@ discard block |
||
801 | 801 | * These values MAY be prepared from $_FILES or the message body during |
802 | 802 | * instantiation, or MAY be injected via withUploadedFiles(). |
803 | 803 | * |
804 | - * @return array An array tree of UploadedFileInterface instances; an empty |
|
804 | + * @return UploadedFileInterface[] An array tree of UploadedFileInterface instances; an empty |
|
805 | 805 | * array MUST be returned if no data is present. |
806 | 806 | */ |
807 | 807 | public function getUploadedFiles() |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | * @param string $key |
1135 | 1135 | * @param mixed $default |
1136 | 1136 | * |
1137 | - * @return mixed |
|
1137 | + * @return null|string |
|
1138 | 1138 | */ |
1139 | 1139 | public function getParsedBodyParam($key, $default = null) |
1140 | 1140 | { |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $this->headers->set('Host', $this->uri->getHost()); |
202 | 202 | } |
203 | 203 | |
204 | - $this->registerMediaTypeParser('application/json', function ($input) { |
|
204 | + $this->registerMediaTypeParser('application/json', function($input) { |
|
205 | 205 | $result = json_decode($input, true); |
206 | 206 | if (!is_array($result)) { |
207 | 207 | return null; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | return $result; |
210 | 210 | }); |
211 | 211 | |
212 | - $this->registerMediaTypeParser('application/xml', function ($input) { |
|
212 | + $this->registerMediaTypeParser('application/xml', function($input) { |
|
213 | 213 | $backup = libxml_disable_entity_loader(true); |
214 | 214 | $backup_errors = libxml_use_internal_errors(true); |
215 | 215 | $result = simplexml_load_string($input); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | return $result; |
223 | 223 | }); |
224 | 224 | |
225 | - $this->registerMediaTypeParser('text/xml', function ($input) { |
|
225 | + $this->registerMediaTypeParser('text/xml', function($input) { |
|
226 | 226 | $backup = libxml_disable_entity_loader(true); |
227 | 227 | $backup_errors = libxml_use_internal_errors(true); |
228 | 228 | $result = simplexml_load_string($input); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | return $result; |
236 | 236 | }); |
237 | 237 | |
238 | - $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { |
|
238 | + $this->registerMediaTypeParser('application/x-www-form-urlencoded', function($input) { |
|
239 | 239 | parse_str($input, $data); |
240 | 240 | return $data; |
241 | 241 | }); |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | // look for a media type with a structured syntax suffix (RFC 6839) |
1032 | 1032 | $parts = explode('+', $mediaType); |
1033 | 1033 | if (count($parts) >= 2) { |
1034 | - $mediaType = 'application/' . $parts[count($parts)-1]; |
|
1034 | + $mediaType = 'application/' . $parts[count($parts) - 1]; |
|
1035 | 1035 | } |
1036 | 1036 | |
1037 | 1037 | if (isset($this->bodyParsers[$mediaType]) === true) { |
@@ -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 | */ |
@@ -63,7 +63,7 @@ |
||
63 | 63 | $this->seedMiddlewareStack(); |
64 | 64 | } |
65 | 65 | $next = $this->stack->top(); |
66 | - $this->stack[] = function ( |
|
66 | + $this->stack[] = function( |
|
67 | 67 | ServerRequestInterface $request, |
68 | 68 | ResponseInterface $response |
69 | 69 | ) 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 | } |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | { |
623 | 623 | return preg_replace_callback( |
624 | 624 | '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/', |
625 | - function ($match) { |
|
625 | + function($match) { |
|
626 | 626 | return rawurlencode($match[0]); |
627 | 627 | }, |
628 | 628 | $path |
@@ -695,7 +695,7 @@ discard block |
||
695 | 695 | { |
696 | 696 | return preg_replace_callback( |
697 | 697 | '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/', |
698 | - function ($match) { |
|
698 | + function($match) { |
|
699 | 699 | return rawurlencode($match[0]); |
700 | 700 | }, |
701 | 701 | $query |