@@ -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 | } |
@@ -126,7 +126,7 @@ |
||
126 | 126 | } |
127 | 127 | } |
128 | 128 | |
129 | - throw new \BadMethodCallException("Method $method is not a valid method"); |
|
129 | + throw new \BadMethodCallException("method $method is not a valid method"); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /******************************************************************************** |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function redirect($from, $to, $status = 302) |
261 | 261 | { |
262 | - $handler = function ($request, ResponseInterface $response) use ($to, $status) { |
|
262 | + $handler = function($request, ResponseInterface $response) use ($to, $status) { |
|
263 | 263 | return $response->withHeader('Location', (string)$to)->withStatus($status); |
264 | 264 | }; |
265 | 265 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $router = $this->container->get('router'); |
504 | 504 | |
505 | 505 | // If router hasn't been dispatched or the URI changed then dispatch |
506 | - if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string) $request->getUri()])) { |
|
506 | + if (null === $routeInfo || ($routeInfo['request'] !== [$request->getMethod(), (string)$request->getUri()])) { |
|
507 | 507 | $request = $this->dispatchRouterAndPrepareRoute($request, $router); |
508 | 508 | $routeInfo = $request->getAttribute('routeInfo'); |
509 | 509 | } |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | $request = $request->withAttribute('route', $route); |
596 | 596 | } |
597 | 597 | |
598 | - $routeInfo['request'] = [$request->getMethod(), (string) $request->getUri()]; |
|
598 | + $routeInfo['request'] = [$request->getMethod(), (string)$request->getUri()]; |
|
599 | 599 | |
600 | 600 | return $request->withAttribute('routeInfo', $routeInfo); |
601 | 601 | } |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | } |
625 | 625 | $size = $response->getBody()->getSize(); |
626 | 626 | if ($size !== null && !$response->hasHeader('Content-Length')) { |
627 | - $response = $response->withHeader('Content-Length', (string) $size); |
|
627 | + $response = $response->withHeader('Content-Length', (string)$size); |
|
628 | 628 | } |
629 | 629 | } |
630 | 630 |
@@ -121,6 +121,6 @@ |
||
121 | 121 | <a href='$homeUrl'>Visit the Home Page</a> |
122 | 122 | </body> |
123 | 123 | </html> |
124 | -END; |
|
124 | +end; |
|
125 | 125 | } |
126 | 126 | } |
@@ -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 | } |
@@ -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 |