@@ -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!'); |
@@ -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 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function __construct($displayErrorDetails = false) |
| 27 | 27 | { |
| 28 | - $this->displayErrorDetails = (bool) $displayErrorDetails; |
|
| 28 | + $this->displayErrorDetails = (bool)$displayErrorDetails; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -94,7 +94,7 @@ |
||
| 94 | 94 | * |
| 95 | 95 | * @return array|\ArrayAccess |
| 96 | 96 | */ |
| 97 | - $this['settings'] = function () use ($userSettings, $defaultSettings) { |
|
| 97 | + $this['settings'] = function() use ($userSettings, $defaultSettings) { |
|
| 98 | 98 | return new Collection(array_merge($defaultSettings, $userSettings)); |
| 99 | 99 | }; |
| 100 | 100 | |
@@ -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 | } |
@@ -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 |
@@ -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 | { |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $this->headers->set('Host', $this->uri->getHost() . $port); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - $this->registerMediaTypeParser('application/json', function ($input) { |
|
| 206 | + $this->registerMediaTypeParser('application/json', function($input) { |
|
| 207 | 207 | $result = json_decode($input, true); |
| 208 | 208 | if (!is_array($result)) { |
| 209 | 209 | return null; |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | return $result; |
| 212 | 212 | }); |
| 213 | 213 | |
| 214 | - $this->registerMediaTypeParser('application/xml', function ($input) { |
|
| 214 | + $this->registerMediaTypeParser('application/xml', function($input) { |
|
| 215 | 215 | $backup = libxml_disable_entity_loader(true); |
| 216 | 216 | $backup_errors = libxml_use_internal_errors(true); |
| 217 | 217 | $result = simplexml_load_string($input); |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | return $result; |
| 225 | 225 | }); |
| 226 | 226 | |
| 227 | - $this->registerMediaTypeParser('text/xml', function ($input) { |
|
| 227 | + $this->registerMediaTypeParser('text/xml', function($input) { |
|
| 228 | 228 | $backup = libxml_disable_entity_loader(true); |
| 229 | 229 | $backup_errors = libxml_use_internal_errors(true); |
| 230 | 230 | $result = simplexml_load_string($input); |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | return $result; |
| 238 | 238 | }); |
| 239 | 239 | |
| 240 | - $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) { |
|
| 240 | + $this->registerMediaTypeParser('application/x-www-form-urlencoded', function($input) { |
|
| 241 | 241 | parse_str($input, $data); |
| 242 | 242 | return $data; |
| 243 | 243 | }); |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | // look for a media type with a structured syntax suffix (RFC 6839) |
| 1034 | 1034 | $parts = explode('+', $mediaType); |
| 1035 | 1035 | if (count($parts) >= 2) { |
| 1036 | - $mediaType = 'application/' . $parts[count($parts)-1]; |
|
| 1036 | + $mediaType = 'application/' . $parts[count($parts) - 1]; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | 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 | */ |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | /** |
| 68 | 68 | * Render plain not found message |
| 69 | 69 | * |
| 70 | - * @return ResponseInterface |
|
| 70 | + * @return string |
|
| 71 | 71 | */ |
| 72 | 72 | protected function renderPlainNotFoundOutput() |
| 73 | 73 | { |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | /** |
| 78 | 78 | * Return a response for application/json content not found |
| 79 | 79 | * |
| 80 | - * @return ResponseInterface |
|
| 80 | + * @return string |
|
| 81 | 81 | */ |
| 82 | 82 | protected function renderJsonNotFoundOutput() |
| 83 | 83 | { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | /** |
| 88 | 88 | * Return a response for xml content not found |
| 89 | 89 | * |
| 90 | - * @return ResponseInterface |
|
| 90 | + * @return string |
|
| 91 | 91 | */ |
| 92 | 92 | protected function renderXmlNotFoundOutput() |
| 93 | 93 | { |