Completed
Branch 3.x (c13855)
by Sam
02:41
created
example/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,12 +26,12 @@
 block discarded – undo
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!');
Please login to merge, or discard this patch.
Slim/App.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Slim/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Slim/MiddlewareAwareTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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 (
Please login to merge, or discard this patch.
Slim/Http/Response.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -211,7 +211,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Slim/Http/Request.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -201,25 +201,25 @@  discard block
 block discarded – undo
201 201
             $this->headers->set('Host', $this->uri->getHost());
202 202
         }
203 203
 
204
-        $this->registerMediaTypeParser('application/json', function ($input) {
204
+        $this->registerMediaTypeParser('application/json', function($input) {
205 205
             return json_decode($input, true);
206 206
         });
207 207
 
208
-        $this->registerMediaTypeParser('application/xml', function ($input) {
208
+        $this->registerMediaTypeParser('application/xml', function($input) {
209 209
             $backup = libxml_disable_entity_loader(true);
210 210
             $result = simplexml_load_string($input);
211 211
             libxml_disable_entity_loader($backup);
212 212
             return $result;
213 213
         });
214 214
 
215
-        $this->registerMediaTypeParser('text/xml', function ($input) {
215
+        $this->registerMediaTypeParser('text/xml', function($input) {
216 216
             $backup = libxml_disable_entity_loader(true);
217 217
             $result = simplexml_load_string($input);
218 218
             libxml_disable_entity_loader($backup);
219 219
             return $result;
220 220
         });
221 221
 
222
-        $this->registerMediaTypeParser('application/x-www-form-urlencoded', function ($input) {
222
+        $this->registerMediaTypeParser('application/x-www-form-urlencoded', function($input) {
223 223
             parse_str($input, $data);
224 224
             return $data;
225 225
         });
@@ -1015,7 +1015,7 @@  discard block
 block discarded – undo
1015 1015
         // look for a media type with a structured syntax suffix (RFC 6839)
1016 1016
         $parts = explode('+', $mediaType);
1017 1017
         if (count($parts) >= 2) {
1018
-            $mediaType = 'application/' . $parts[count($parts)-1];
1018
+            $mediaType = 'application/' . $parts[count($parts) - 1];
1019 1019
         }
1020 1020
 
1021 1021
         if (isset($this->bodyParsers[$mediaType]) === true) {
Please login to merge, or discard this patch.
Slim/Http/Headers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Slim/Http/Uri.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -186,12 +186,12 @@  discard block
 block discarded – undo
186 186
             $host = $matches[1];
187 187
 
188 188
             if ($matches[2]) {
189
-                $port = (int) substr($matches[2], 1);
189
+                $port = (int)substr($matches[2], 1);
190 190
             }
191 191
         } else {
192 192
             $pos = strpos($host, ':');
193 193
             if ($pos !== false) {
194
-                $port = (int) substr($host, $pos + 1);
194
+                $port = (int)substr($host, $pos + 1);
195 195
                 $host = strstr($host, ':', true);
196 196
             }
197 197
         }
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
     {
623 623
         return preg_replace_callback(
624 624
             '/(?:[^a-zA-Z0-9_\-\.~:@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/',
625
-            function ($match) {
625
+            function($match) {
626 626
                 return rawurlencode($match[0]);
627 627
             },
628 628
             $path
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
     {
696 696
         return preg_replace_callback(
697 697
             '/(?:[^a-zA-Z0-9_\-\.~!\$&\'\(\)\*\+,;=%:@\/\?]+|%(?![A-Fa-f0-9]{2}))/',
698
-            function ($match) {
698
+            function($match) {
699 699
                 return rawurlencode($match[0]);
700 700
             },
701 701
             $query
Please login to merge, or discard this patch.
Slim/Router.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@
 block discarded – undo
222 222
             return $this->dispatcher;
223 223
         }
224 224
 
225
-        $routeDefinitionCallback = function (RouteCollector $r) {
225
+        $routeDefinitionCallback = function(RouteCollector $r) {
226 226
             foreach ($this->getRoutes() as $route) {
227 227
                 $r->addRoute($route->getMethods(), $route->getPattern(), $route->getIdentifier());
228 228
             }
Please login to merge, or discard this patch.