@@ -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!'); |
@@ -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 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $this->seedMiddlewareStack(); |
| 61 | 61 | } |
| 62 | 62 | $next = $this->tip; |
| 63 | - $this->tip = function ( |
|
| 63 | + $this->tip = function( |
|
| 64 | 64 | ServerRequestInterface $request, |
| 65 | 65 | ResponseInterface $response |
| 66 | 66 | ) use ( |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | - * @param array $result |
|
| 95 | + * @param integer[] $result |
|
| 96 | 96 | * @return RoutingResults |
| 97 | 97 | */ |
| 98 | 98 | protected function routingResultsFromVariableRouteResults(array $result): RoutingResults |
@@ -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|string $callable The route callable |
| 78 | 78 | * @param RouteGroup[] $groups The parent route groups |
@@ -320,7 +320,7 @@ |
||
| 320 | 320 | $handler = $this->routeInvocationStrategy; |
| 321 | 321 | |
| 322 | 322 | $routeResponse = $handler($callable, $request, $response, $this->arguments); |
| 323 | - if (! $routeResponse instanceof ResponseInterface) { |
|
| 323 | + if (!$routeResponse instanceof ResponseInterface) { |
|
| 324 | 324 | throw new \RuntimeException('Route handler must return instance of \Psr\Http\Message\ResponseInterface'); |
| 325 | 325 | } |
| 326 | 326 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function getCallableResolver(): CallableResolverInterface |
| 204 | 204 | { |
| 205 | - if (! $this->callableResolver instanceof CallableResolverInterface) { |
|
| 205 | + if (!$this->callableResolver instanceof CallableResolverInterface) { |
|
| 206 | 206 | $this->callableResolver = new CallableResolver($this->container); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | */ |
| 227 | 227 | public function getRouter(): RouterInterface |
| 228 | 228 | { |
| 229 | - if (! $this->router instanceof RouterInterface) { |
|
| 229 | + if (!$this->router instanceof RouterInterface) { |
|
| 230 | 230 | $router = new Router(); |
| 231 | 231 | $resolver = $this->getCallableResolver(); |
| 232 | 232 | if ($resolver instanceof CallableResolverInterface) { |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public function redirect(string $from, $to, int $status = 302): RouteInterface |
| 371 | 371 | { |
| 372 | - $handler = function ($request, ResponseInterface $response) use ($to, $status) { |
|
| 372 | + $handler = function($request, ResponseInterface $response) use ($to, $status) { |
|
| 373 | 373 | return $response->withHeader('Location', (string)$to)->withStatus($status); |
| 374 | 374 | }; |
| 375 | 375 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $body->rewind(); |
| 474 | 474 | } |
| 475 | 475 | $chunkSize = $this->getSetting('responseChunkSize', 4096); |
| 476 | - $contentLength = $response->getHeaderLine('Content-Length'); |
|
| 476 | + $contentLength = $response->getHeaderLine('Content-Length'); |
|
| 477 | 477 | if (!$contentLength) { |
| 478 | 478 | $contentLength = $body->getSize(); |
| 479 | 479 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | // Add Content-Length header if not already added |
| 36 | 36 | $size = $response->getBody()->getSize(); |
| 37 | 37 | if ($size !== null && !$response->hasHeader('Content-Length')) { |
| 38 | - $response = $response->withHeader('Content-Length', (string) $size); |
|
| 38 | + $response = $response->withHeader('Content-Length', (string)$size); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | return $response; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | } while ($exception = $exception->getPrevious()); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - return json_encode($error, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); |
|
| 38 | + return json_encode($error, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |