Completed
Push — master ( fc8ad1...2dac1f )
by Chauncey
45s
created
src/Charcoal/App/Route/TemplateRouteConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@
 block discarded – undo
177 177
     public function setRedirectMode($redirectMode)
178 178
     {
179 179
         $redirectMode = (int)$redirectMode;
180
-        if ($redirectMode < 300 || $redirectMode  >= 400) {
180
+        if ($redirectMode < 300 || $redirectMode >= 400) {
181 181
             throw new InvalidArgumentException(
182 182
                 'Invalid HTTP status for redirect mode'
183 183
             );
Please login to merge, or discard this patch.
src/Charcoal/App/Module/AbstractModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
     {
119 119
         if (!isset($this->routeManager)) {
120 120
             $config = $this->config();
121
-            $routes = (isset($config['routes']) ? $config['routes'] : [] );
121
+            $routes = (isset($config['routes']) ? $config['routes'] : []);
122 122
 
123 123
             $this->routeManager = new RouteManager([
124 124
                 'config' => $routes,
Please login to merge, or discard this patch.
src/Charcoal/App/CallableResolverAwareTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,22 +87,22 @@
 block discarded – undo
87 87
                 $method = $matches[2];
88 88
 
89 89
                 if (is_object($context)) {
90
-                    $callable = [ $context, $method ];
90
+                    $callable = [$context, $method];
91 91
                 }
92 92
 
93 93
                 if (!is_callable($callable)) {
94 94
                     switch ($class) {
95 95
                         case '':
96 96
                         case 'self':
97
-                            $callable = [ $this, $method ];
97
+                            $callable = [$this, $method];
98 98
                             break;
99 99
 
100 100
                         case 'static':
101
-                            $callable = [ static::class, $method ];
101
+                            $callable = [static::class, $method];
102 102
                             break;
103 103
 
104 104
                         case 'parent':
105
-                            $callable = [ $this, 'parent::'.$method ];
105
+                            $callable = [$this, 'parent::'.$method];
106 106
                             break;
107 107
                     }
108 108
                 }
Please login to merge, or discard this patch.
src/Charcoal/App/Script/ArgScriptTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         foreach ($params as $key => $param) {
55 55
             $setter = $this->setter($key);
56 56
 
57
-            if (!is_callable([ $this, $setter ])) {
57
+            if (!is_callable([$this, $setter])) {
58 58
                 continue;
59 59
             }
60 60
 
Please login to merge, or discard this patch.
src/Charcoal/App/Route/RouteConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
      *
41 41
      * @var string[]
42 42
      */
43
-    private $methods = [ 'GET' ];
43
+    private $methods = ['GET'];
44 44
 
45 45
     /**
46 46
      * Response controller classname
Please login to merge, or discard this patch.
src/Charcoal/App/Script/PathScriptTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
     public function processMultiplePaths($paths)
39 39
     {
40 40
         $paths = $this->parseAsArray($paths);
41
-        $paths = array_map([ $this, 'filterPath' ], $paths);
42
-        $paths = array_filter($paths, [ $this, 'pathExists' ]);
41
+        $paths = array_map([$this, 'filterPath'], $paths);
42
+        $paths = array_filter($paths, [$this, 'pathExists']);
43 43
 
44 44
         if ($paths === false) {
45 45
             throw new InvalidArgumentException('Received invalid paths.');
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 
162 162
         $depth = 1;
163 163
         $files = glob($pattern, $flags);
164
-        foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR|GLOB_NOSORT)) as $dir) {
164
+        foreach (glob(dirname($pattern).'/*', (GLOB_ONLYDIR | GLOB_NOSORT)) as $dir) {
165 165
             $files = array_merge($files, $this->globRecursive($dir.'/'.basename($pattern), $flags));
166 166
             $depth++;
167 167
             if ($maxDepth > 0 && $depth >= $maxDepth) {
Please login to merge, or discard this patch.
src/Charcoal/App/AppContainer.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
     private function registerProviderFactory()
61 61
     {
62 62
         /**
63
-        * @return Factory
64
-        */
63
+         * @return Factory
64
+         */
65 65
         if (!isset($this['provider/factory'])) {
66 66
             $this['provider/factory'] = function () {
67 67
                 return new Factory([
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
         * @return Factory
64 64
         */
65 65
         if (!isset($this['provider/factory'])) {
66
-            $this['provider/factory'] = function () {
66
+            $this['provider/factory'] = function() {
67 67
                 return new Factory([
68 68
                     'base_class'       => ServiceProviderInterface::class,
69 69
                     'resolver_options' => [
Please login to merge, or discard this patch.
src/Charcoal/App/ServiceProvider/AppServiceProvider.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -473,8 +473,8 @@
 block discarded – undo
473 473
                                 $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';
474 474
 
475 475
                                 $uri = $baseUrl->withPath($path)
476
-                                               ->withQuery($query)
477
-                                               ->withFragment($hash);
476
+                                                ->withQuery($query)
477
+                                                ->withFragment($hash);
478 478
                             }
479 479
                         }
480 480
                     }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
              * @param  Container $container A service container.
122 122
              * @return boolean
123 123
              */
124
-            $container['debug'] = function (Container $container) {
124
+            $container['debug'] = function(Container $container) {
125 125
                 if (isset($container['config']['debug'])) {
126 126
                     return !!$container['config']['debug'];
127 127
                 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
              * @param  Container $container A service container.
143 143
              * @return \Psr\Http\Message\UriInterface
144 144
              */
145
-            $container['base-url'] = function (Container $container) {
145
+            $container['base-url'] = function(Container $container) {
146 146
                 if (isset($container['config']['base_url'])) {
147 147
                     $baseUrl = $container['config']['base_url'];
148 148
                 } else {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
              * @param  Container                                     $container A container instance.
194 194
              * @return \Charcoal\App\Handler\HandlerInterface
195 195
              */
196
-            $container->extend('notFoundHandler', function ($handler, Container $container) use ($handlersConfig) {
196
+            $container->extend('notFoundHandler', function($handler, Container $container) use ($handlersConfig) {
197 197
                 if ($handler instanceof \Slim\Handlers\NotFound) {
198 198
                     $config  = ($handlersConfig['notFound'] ?? []);
199 199
                     $class   = $container['notFoundHandler/class'];
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
              * @param  Container                                     $container A container instance.
214 214
              * @return \Charcoal\App\Handler\HandlerInterface
215 215
              */
216
-            $container->extend('notAllowedHandler', function ($handler, Container $container) use ($handlersConfig) {
216
+            $container->extend('notAllowedHandler', function($handler, Container $container) use ($handlersConfig) {
217 217
                 if ($handler instanceof \Slim\Handlers\NotAllowed) {
218 218
                     $config  = ($handlersConfig['notAllowed'] ?? []);
219 219
                     $class   = $container['notAllowedHandler/class'];
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
              * @param  Container                                     $container A container instance.
234 234
              * @return \Charcoal\App\Handler\HandlerInterface
235 235
              */
236
-            $container->extend('phpErrorHandler', function ($handler, Container $container) use ($handlersConfig) {
236
+            $container->extend('phpErrorHandler', function($handler, Container $container) use ($handlersConfig) {
237 237
                 if ($handler instanceof \Slim\Handlers\PhpError) {
238 238
                     $config  = ($handlersConfig['phpError'] ?? []);
239 239
                     $class   = $container['phpErrorHandler/class'];
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
              * @param  Container                                     $container A container instance.
254 254
              * @return \Charcoal\App\Handler\HandlerInterface
255 255
              */
256
-            $container->extend('errorHandler', function ($handler, Container $container) use ($handlersConfig) {
256
+            $container->extend('errorHandler', function($handler, Container $container) use ($handlersConfig) {
257 257
                 if ($handler instanceof \Slim\Handlers\Error) {
258 258
                     $config  = ($handlersConfig['error'] ?? []);
259 259
                     $class   = $container['errorHandler/class'];
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
              * @param  Container $container A service container.
275 275
              * @return \Charcoal\App\Handler\HandlerInterface
276 276
              */
277
-            $container['maintenanceHandler'] = function (Container $container) use ($handlersConfig) {
277
+            $container['maintenanceHandler'] = function(Container $container) use ($handlersConfig) {
278 278
                 $config  = ($handlersConfig['maintenance'] ?? []);
279 279
                 $class   = $container['maintenanceHandler/class'];
280 280
                 $handler = new $class($container, $config);
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
          * @param  Container $container A service container.
303 303
          * @return \Charcoal\Factory\FactoryInterface
304 304
          */
305
-        $container['route/factory'] = function (Container $container) {
305
+        $container['route/factory'] = function(Container $container) {
306 306
             return new Factory([
307 307
                 'base_class'       => RouteInterface::class,
308 308
                 'resolver_options' => [
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
          * @param  Container $container A service container.
349 349
          * @return \Charcoal\Factory\FactoryInterface
350 350
          */
351
-        $container['action/factory'] = function (Container $container) {
351
+        $container['action/factory'] = function(Container $container) {
352 352
             return new Factory([
353 353
                 'base_class'       => ActionInterface::class,
354 354
                 'resolver_options' => [
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
          * @param  Container $container A service container.
373 373
          * @return \Charcoal\Factory\FactoryInterface
374 374
          */
375
-        $container['template/factory'] = function (Container $container) {
375
+        $container['template/factory'] = function(Container $container) {
376 376
             return new Factory([
377 377
                 'base_class'       => TemplateInterface::class,
378 378
                 'resolver_options' => [
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
          * @param  Container $container A service container.
397 397
          * @return \Charcoal\Factory\FactoryInterface
398 398
          */
399
-        $container['widget/factory'] = function (Container $container) {
399
+        $container['widget/factory'] = function(Container $container) {
400 400
             return new Factory([
401 401
                 'base_class'       => WidgetInterface::class,
402 402
                 'resolver_options' => [
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
          * @param  Container $container A service container.
416 416
          * @return WidgetBuilder
417 417
          */
418
-        $container['widget/builder'] = function (Container $container) {
418
+        $container['widget/builder'] = function(Container $container) {
419 419
             return new WidgetBuilder($container['widget/factory'], $container);
420 420
         };
421 421
     }
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
          * @param  Container $container A service container.
435 435
          * @return \Charcoal\Factory\FactoryInterface
436 436
          */
437
-        $container['module/factory'] = function (Container $container) {
437
+        $container['module/factory'] = function(Container $container) {
438 438
             return new Factory([
439 439
                 'base_class'       => ModuleInterface::class,
440 440
                 'resolver_options' => [
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
          * @param  Container $container A service container.
455 455
          * @return array
456 456
          */
457
-        $container['module/classes'] = function (Container $container) {
457
+        $container['module/classes'] = function(Container $container) {
458 458
             $appConfig = $container['config'];
459 459
 
460 460
             $modules = $appConfig['modules'];
@@ -464,11 +464,11 @@  discard block
 block discarded – undo
464 464
                 'suffix' => 'Module',
465 465
             ]);
466 466
 
467
-            $modules = array_map(function ($module) use ($moduleResolver) {
467
+            $modules = array_map(function($module) use ($moduleResolver) {
468 468
                 return $moduleResolver->resolve($module);
469 469
             }, $modules);
470 470
 
471
-            array_filter($modules, function ($class) {
471
+            array_filter($modules, function($class) {
472 472
                 return class_exists($class);
473 473
             });
474 474
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
     protected function registerViewServices(Container $container)
486 486
     {
487 487
         if (!isset($container['view/mustache/helpers'])) {
488
-            $container['view/mustache/helpers'] = function () {
488
+            $container['view/mustache/helpers'] = function() {
489 489
                 return [];
490 490
             };
491 491
         }
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
          *
496 496
          * @return array
497 497
          */
498
-        $container->extend('view/mustache/helpers', function (array $helpers, Container $container) {
498
+        $container->extend('view/mustache/helpers', function(array $helpers, Container $container) {
499 499
             $baseUrl = $container['base-url'];
500 500
             $urls = [
501 501
                 /**
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
                  * @param  string $uri A URI path to wrap.
523 523
                  * @return UriInterface|null
524 524
                  */
525
-                'withBaseUrl' => function ($uri, LambdaHelper $helper = null) use ($baseUrl) {
525
+                'withBaseUrl' => function($uri, LambdaHelper $helper = null) use ($baseUrl) {
526 526
                     if ($helper) {
527 527
                         $uri = $helper->render($uri);
528 528
                     }
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
                     } else {
534 534
                         $parts = parse_url($uri);
535 535
                         if (!isset($parts['scheme'])) {
536
-                            if (!in_array($uri[0], [ '/', '#', '?' ])) {
536
+                            if (!in_array($uri[0], ['/', '#', '?'])) {
537 537
                                 $path  = isset($parts['path']) ? $parts['path'] : '';
538 538
                                 $query = isset($parts['query']) ? $parts['query'] : '';
539 539
                                 $hash  = isset($parts['fragment']) ? $parts['fragment'] : '';
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 
548 548
                     return $uri;
549 549
                 },
550
-                'renderContext' => function ($text, LambdaHelper $helper = null) {
550
+                'renderContext' => function($text, LambdaHelper $helper = null) {
551 551
                     return $helper->render('{{>'.$helper->render($text).'}}');
552 552
                 },
553 553
             ];
Please login to merge, or discard this patch.
src/Charcoal/App/Handler/NotAllowed.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 
80 80
         return $this->respondWith(
81 81
             $response->withStatus($status)
82
-                     ->withHeader('Allow', $this->getMethods()),
82
+                        ->withHeader('Allow', $this->getMethods()),
83 83
             $contentType,
84 84
             $output
85 85
         );
Please login to merge, or discard this patch.