| @@ -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 |      { | 
| @@ -140,7 +140,7 @@ | ||
| 140 | 140 | <p>Method not allowed. Must be one of: <strong>$allow</strong></p> | 
| 141 | 141 | </body> | 
| 142 | 142 | </html> | 
| 143 | -END; | |
| 143 | +end; | |
| 144 | 144 | |
| 145 | 145 | return $output; | 
| 146 | 146 | } | 
| @@ -201,7 +201,7 @@ | ||
| 201 | 201 | * new and/or updated header and value. | 
| 202 | 202 | * | 
| 203 | 203 | * @param string $name Case-insensitive header field name. | 
| 204 | - * @param string|string[] $value Header value(s). | |
| 204 | + * @param string $value Header value(s). | |
| 205 | 205 | * @return static | 
| 206 | 206 | * @throws \InvalidArgumentException for invalid header names or values. | 
| 207 | 207 | */ | 
| @@ -783,7 +783,7 @@ | ||
| 783 | 783 | * These values MAY be prepared from $_FILES or the message body during | 
| 784 | 784 | * instantiation, or MAY be injected via withUploadedFiles(). | 
| 785 | 785 | * | 
| 786 | - * @return array An array tree of UploadedFileInterface instances; an empty | |
| 786 | + * @return UploadedFileInterface[] An array tree of UploadedFileInterface instances; an empty | |
| 787 | 787 | * array MUST be returned if no data is present. | 
| 788 | 788 | */ | 
| 789 | 789 | public function getUploadedFiles() | 
| @@ -193,25 +193,25 @@ discard block | ||
| 193 | 193 |              $this->headers->set('Host', $this->uri->getHost()); | 
| 194 | 194 | } | 
| 195 | 195 | |
| 196 | -        $this->registerMediaTypeParser('application/json', function ($input) { | |
| 196 | +        $this->registerMediaTypeParser('application/json', function($input) { | |
| 197 | 197 | return json_decode($input, true); | 
| 198 | 198 | }); | 
| 199 | 199 | |
| 200 | -        $this->registerMediaTypeParser('application/xml', function ($input) { | |
| 200 | +        $this->registerMediaTypeParser('application/xml', function($input) { | |
| 201 | 201 | $backup = libxml_disable_entity_loader(true); | 
| 202 | 202 | $result = simplexml_load_string($input); | 
| 203 | 203 | libxml_disable_entity_loader($backup); | 
| 204 | 204 | return $result; | 
| 205 | 205 | }); | 
| 206 | 206 | |
| 207 | -        $this->registerMediaTypeParser('text/xml', function ($input) { | |
| 207 | +        $this->registerMediaTypeParser('text/xml', function($input) { | |
| 208 | 208 | $backup = libxml_disable_entity_loader(true); | 
| 209 | 209 | $result = simplexml_load_string($input); | 
| 210 | 210 | libxml_disable_entity_loader($backup); | 
| 211 | 211 | return $result; | 
| 212 | 212 | }); | 
| 213 | 213 | |
| 214 | -        $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { | |
| 214 | +        $this->registerMediaTypeParser('application/x-www-form-urlencoded', function($input) { | |
| 215 | 215 | parse_str($input, $data); | 
| 216 | 216 | return $data; | 
| 217 | 217 | }); | 
| @@ -971,7 +971,7 @@ discard block | ||
| 971 | 971 | // look for a media type with a structured syntax suffix (RFC 6839) | 
| 972 | 972 |          $parts = explode('+', $mediaType); | 
| 973 | 973 |          if (count($parts) >= 2) { | 
| 974 | - $mediaType = 'application/' . $parts[count($parts)-1]; | |
| 974 | + $mediaType = 'application/' . $parts[count($parts) - 1]; | |
| 975 | 975 | } | 
| 976 | 976 | |
| 977 | 977 |          if (isset($this->bodyParsers[$mediaType]) === true) { | 
| @@ -147,7 +147,7 @@ | ||
| 147 | 147 | * | 
| 148 | 148 | * After the stream has been detached, the stream is in an unusable state. | 
| 149 | 149 | * | 
| 150 | - * @return resource|null Underlying PHP stream, if any | |
| 150 | + * @return resource Underlying PHP stream, if any | |
| 151 | 151 | */ | 
| 152 | 152 | public function detach() | 
| 153 | 153 |      { | 
| @@ -285,7 +285,7 @@ discard block | ||
| 285 | 285 | * Implementations SHOULD return the value stored in the "name" key of | 
| 286 | 286 | * the file in the $_FILES array. | 
| 287 | 287 | * | 
| 288 | - * @return string|null The filename sent by the client or null if none | |
| 288 | + * @return string The filename sent by the client or null if none | |
| 289 | 289 | * was provided. | 
| 290 | 290 | */ | 
| 291 | 291 | public function getClientFilename() | 
| @@ -303,7 +303,7 @@ discard block | ||
| 303 | 303 | * Implementations SHOULD return the value stored in the "type" key of | 
| 304 | 304 | * the file in the $_FILES array. | 
| 305 | 305 | * | 
| 306 | - * @return string|null The media type sent by the client or null if none | |
| 306 | + * @return string The media type sent by the client or null if none | |
| 307 | 307 | * was provided. | 
| 308 | 308 | */ | 
| 309 | 309 | public function getClientMediaType() | 
| @@ -318,7 +318,7 @@ discard block | ||
| 318 | 318 | * the file in the $_FILES array if available, as PHP calculates this based | 
| 319 | 319 | * on the actual size transmitted. | 
| 320 | 320 | * | 
| 321 | - * @return int|null The file size in bytes or null if unknown. | |
| 321 | + * @return integer The file size in bytes or null if unknown. | |
| 322 | 322 | */ | 
| 323 | 323 | public function getSize() | 
| 324 | 324 |      { | 
| @@ -15,7 +15,6 @@ | ||
| 15 | 15 | use FastRoute\RouteCollector; | 
| 16 | 16 | use FastRoute\RouteParser; | 
| 17 | 17 | use FastRoute\RouteParser\Std as StdParser; | 
| 18 | -use FastRoute\DataGenerator; | |
| 19 | 18 | use Slim\Interfaces\RouteGroupInterface; | 
| 20 | 19 | use Slim\Interfaces\RouterInterface; | 
| 21 | 20 | use Slim\Interfaces\RouteInterface; | 
| @@ -188,7 +188,7 @@ | ||
| 188 | 188 | return $this->dispatcher; | 
| 189 | 189 | } | 
| 190 | 190 | |
| 191 | -        $routeDefinitionCallback = function (RouteCollector $r) { | |
| 191 | +        $routeDefinitionCallback = function(RouteCollector $r) { | |
| 192 | 192 |              foreach ($this->getRoutes() as $route) { | 
| 193 | 193 | $r->addRoute($route->getMethods(), $route->getPattern(), $route->getIdentifier()); | 
| 194 | 194 | } | 
| @@ -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!'); | 
| @@ -207,7 +207,7 @@ | ||
| 207 | 207 | */ | 
| 208 | 208 | protected function filterStatus($status) | 
| 209 | 209 |      { | 
| 210 | -        if (!is_integer($status) || $status<100 || $status>599) { | |
| 210 | +        if (!is_integer($status) || $status < 100 || $status > 599) { | |
| 211 | 211 |              throw new InvalidArgumentException('Invalid HTTP status code'); | 
| 212 | 212 | } | 
| 213 | 213 | |
| @@ -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 | } |