@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | /** |
63 | 63 | * Return a response for application/json content not found |
64 | 64 | * |
65 | - * @return ResponseInterface |
|
65 | + * @return string |
|
66 | 66 | */ |
67 | 67 | protected function renderJsonNotFoundOutput() |
68 | 68 | { |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * Return a response for xml content not found |
74 | 74 | * |
75 | - * @return ResponseInterface |
|
75 | + * @return string |
|
76 | 76 | */ |
77 | 77 | protected function renderXmlNotFoundOutput() |
78 | 78 | { |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | * These values MAY be prepared from $_FILES or the message body during |
812 | 812 | * instantiation, or MAY be injected via withUploadedFiles(). |
813 | 813 | * |
814 | - * @return array An array tree of UploadedFileInterface instances; an empty |
|
814 | + * @return UploadedFileInterface[] An array tree of UploadedFileInterface instances; an empty |
|
815 | 815 | * array MUST be returned if no data is present. |
816 | 816 | */ |
817 | 817 | public function getUploadedFiles() |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | * @param string $key |
1145 | 1145 | * @param mixed $default |
1146 | 1146 | * |
1147 | - * @return mixed |
|
1147 | + * @return null|string |
|
1148 | 1148 | */ |
1149 | 1149 | public function getParsedBodyParam($key, $default = null) |
1150 | 1150 | { |
@@ -17,7 +17,6 @@ |
||
17 | 17 | use Psr\Http\Message\StreamInterface; |
18 | 18 | use Slim\Collection; |
19 | 19 | use Slim\Exception\InvalidMethodException; |
20 | -use Slim\Exception\MethodNotAllowedException; |
|
21 | 20 | use Slim\Interfaces\Http\HeadersInterface; |
22 | 21 | |
23 | 22 | /** |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $this->headers->set('Host', $this->uri->getHost()); |
203 | 203 | } |
204 | 204 | |
205 | - $this->registerMediaTypeParser('application/json', function ($input) { |
|
205 | + $this->registerMediaTypeParser('application/json', function($input) { |
|
206 | 206 | $result = json_decode($input, true); |
207 | 207 | if (!is_array($result)) { |
208 | 208 | return null; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | return $result; |
211 | 211 | }); |
212 | 212 | |
213 | - $this->registerMediaTypeParser('application/xml', function ($input) { |
|
213 | + $this->registerMediaTypeParser('application/xml', function($input) { |
|
214 | 214 | $backup = libxml_disable_entity_loader(true); |
215 | 215 | $backup_errors = libxml_use_internal_errors(true); |
216 | 216 | $result = simplexml_load_string($input); |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | return $result; |
224 | 224 | }); |
225 | 225 | |
226 | - $this->registerMediaTypeParser('text/xml', function ($input) { |
|
226 | + $this->registerMediaTypeParser('text/xml', function($input) { |
|
227 | 227 | $backup = libxml_disable_entity_loader(true); |
228 | 228 | $backup_errors = libxml_use_internal_errors(true); |
229 | 229 | $result = simplexml_load_string($input); |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | return $result; |
237 | 237 | }); |
238 | 238 | |
239 | - $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { |
|
239 | + $this->registerMediaTypeParser('application/x-www-form-urlencoded', function($input) { |
|
240 | 240 | parse_str($input, $data); |
241 | 241 | return $data; |
242 | 242 | }); |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | // look for a media type with a structured syntax suffix (RFC 6839) |
1033 | 1033 | $parts = explode('+', $mediaType); |
1034 | 1034 | if (count($parts) >= 2) { |
1035 | - $mediaType = 'application/' . $parts[count($parts)-1]; |
|
1035 | + $mediaType = 'application/' . $parts[count($parts) - 1]; |
|
1036 | 1036 | } |
1037 | 1037 | |
1038 | 1038 | if (isset($this->bodyParsers[$mediaType]) === true) { |
@@ -81,7 +81,7 @@ |
||
81 | 81 | /** |
82 | 82 | * Create new route |
83 | 83 | * |
84 | - * @param string|string[] $methods The route HTTP methods |
|
84 | + * @param string[] $methods The route HTTP methods |
|
85 | 85 | * @param string $pattern The route pattern |
86 | 86 | * @param callable $callable The route callable |
87 | 87 | * @param RouteGroup[] $groups The parent route groups |
@@ -13,7 +13,6 @@ |
||
13 | 13 | use InvalidArgumentException; |
14 | 14 | use Psr\Http\Message\ServerRequestInterface; |
15 | 15 | use Psr\Http\Message\ResponseInterface; |
16 | -use Slim\Exception\SlimException; |
|
17 | 16 | use Slim\Handlers\Strategies\RequestResponse; |
18 | 17 | use Slim\Interfaces\InvocationStrategyInterface; |
19 | 18 | use Slim\Interfaces\RouteInterface; |
@@ -26,12 +26,12 @@ |
||
26 | 26 | * argument for `Slim::get`, `Slim::post`, `Slim::put`, `Slim::patch`, and `Slim::delete` |
27 | 27 | * is an anonymous function. |
28 | 28 | */ |
29 | -$app->get('/', function ($request, $response, $args) { |
|
29 | +$app->get('/', function($request, $response, $args) { |
|
30 | 30 | $response->write("Welcome to Slim!"); |
31 | 31 | return $response; |
32 | 32 | }); |
33 | 33 | |
34 | -$app->get('/hello[/{name}]', function ($request, $response, $args) { |
|
34 | +$app->get('/hello[/{name}]', function($request, $response, $args) { |
|
35 | 35 | $response->write("Hello, " . $args['name']); |
36 | 36 | return $response; |
37 | 37 | })->setArgument('name', 'World!'); |
@@ -466,7 +466,7 @@ discard block |
||
466 | 466 | $router = $this->container->get('router'); |
467 | 467 | |
468 | 468 | // If router hasn't been dispatched or the URI changed then dispatch |
469 | - if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string) $request->getUri()])) { |
|
469 | + if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string)$request->getUri()])) { |
|
470 | 470 | $request = $this->dispatchRouterAndPrepareRoute($request, $router); |
471 | 471 | $routeInfo = $request->getAttribute('routeInfo'); |
472 | 472 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $request = $request->withAttribute('route', $route); |
559 | 559 | } |
560 | 560 | |
561 | - $routeInfo['request'] = [$request->getMethod(), (string) $request->getUri()]; |
|
561 | + $routeInfo['request'] = [$request->getMethod(), (string)$request->getUri()]; |
|
562 | 562 | |
563 | 563 | return $request->withAttribute('routeInfo', $routeInfo); |
564 | 564 | } |
@@ -587,7 +587,7 @@ discard block |
||
587 | 587 | } |
588 | 588 | $size = $response->getBody()->getSize(); |
589 | 589 | if ($size !== null && !$response->hasHeader('Content-Length')) { |
590 | - $response = $response->withHeader('Content-Length', (string) $size); |
|
590 | + $response = $response->withHeader('Content-Length', (string)$size); |
|
591 | 591 | } |
592 | 592 | } |
593 | 593 |
@@ -14,7 +14,6 @@ discard block |
||
14 | 14 | use Throwable; |
15 | 15 | use Closure; |
16 | 16 | use InvalidArgumentException; |
17 | -use Psr\Http\Message\RequestInterface; |
|
18 | 17 | use Psr\Http\Message\ServerRequestInterface; |
19 | 18 | use Psr\Http\Message\ResponseInterface; |
20 | 19 | use Psr\Container\ContainerInterface; |
@@ -26,7 +25,6 @@ discard block |
||
26 | 25 | use Slim\Http\Headers; |
27 | 26 | use Slim\Http\Body; |
28 | 27 | use Slim\Http\Request; |
29 | -use Slim\Interfaces\Http\EnvironmentInterface; |
|
30 | 28 | use Slim\Interfaces\RouteGroupInterface; |
31 | 29 | use Slim\Interfaces\RouteInterface; |
32 | 30 | use Slim\Interfaces\RouterInterface; |
@@ -92,7 +92,7 @@ |
||
92 | 92 | * |
93 | 93 | * @return array|\ArrayAccess |
94 | 94 | */ |
95 | - $this['settings'] = function () use ($userSettings, $defaultSettings) { |
|
95 | + $this['settings'] = function() use ($userSettings, $defaultSettings) { |
|
96 | 96 | return new Collection(array_merge($defaultSettings, $userSettings)); |
97 | 97 | }; |
98 | 98 |
@@ -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 ( |
@@ -211,7 +211,7 @@ |
||
211 | 211 | */ |
212 | 212 | protected function filterStatus($status) |
213 | 213 | { |
214 | - if (!is_integer($status) || $status<100 || $status>599) { |
|
214 | + if (!is_integer($status) || $status < 100 || $status > 599) { |
|
215 | 215 | throw new InvalidArgumentException('Invalid HTTP status code'); |
216 | 216 | } |
217 | 217 |
@@ -122,7 +122,7 @@ |
||
122 | 122 | * |
123 | 123 | * @var string |
124 | 124 | */ |
125 | - const EOL = "\r\n"; |
|
125 | + const EOL = "\r\n"; |
|
126 | 126 | |
127 | 127 | /** |
128 | 128 | * Create new HTTP response. |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $key = strtoupper($key); |
57 | 57 | if (isset(static::$special[$key]) || strpos($key, 'HTTP_') === 0) { |
58 | 58 | if ($key !== 'HTTP_CONTENT_LENGTH') { |
59 | - $data[$key] = $value; |
|
59 | + $data[$key] = $value; |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | } |