Completed
Push — master ( 818423...899d9a )
by Mathieu
02:02
created
src/Charcoal/App/ServiceProvider/LoggerServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
          * @param  Container $container A container instance.
55 55
          * @return LoggerConfig
56 56
          */
57
-        $container['logger/config'] = function (Container $container) {
57
+        $container['logger/config'] = function(Container $container) {
58 58
             $appConfig    = isset($container['config']) ? $container['config'] : [];
59 59
             $loggerConfig = isset($appConfig['logger']) ? $appConfig['logger'] : null;
60 60
             return new LoggerConfig($loggerConfig);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         /**
64 64
          * @return FactoryInterface
65 65
          */
66
-        $container['logger/processor/factory'] = function () {
66
+        $container['logger/processor/factory'] = function() {
67 67
             return new Factory([
68 68
                 'map' => [
69 69
                     'memory-usage' => MemoryUsageProcessor::class,
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
          * @param  Container $container A container instance.
77 77
          * @return StreamHandler|null
78 78
          */
79
-        $container['logger/handler/stream'] = function (Container $container) {
79
+        $container['logger/handler/stream'] = function(Container $container) {
80 80
             $loggerConfig  = $container['logger/config'];
81 81
             $handlerConfig = $loggerConfig['handlers.stream'];
82 82
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
          * @param  Container $container A container instance.
93 93
          * @return BrowserConsoleHandler|null
94 94
          */
95
-        $container['logger/handler/browser-console'] = function (Container $container) {
95
+        $container['logger/handler/browser-console'] = function(Container $container) {
96 96
             $loggerConfig  = $container['logger/config'];
97 97
             $handlerConfig = $loggerConfig['handlers.console'];
98 98
 
@@ -108,14 +108,14 @@  discard block
 block discarded – undo
108 108
          * @param  Container $container A container instance.
109 109
          * @return Container Collection of defined record handlers, in a service container.
110 110
          */
111
-        $container['logger/handlers'] = function (Container $container) {
111
+        $container['logger/handlers'] = function(Container $container) {
112 112
             $loggerConfig   = $container['logger/config'];
113 113
             $handlersConfig = $loggerConfig['handlers'];
114 114
             $handlerFactory = $container['logger/handler/factory'];
115 115
 
116 116
             $handlers = new Container();
117 117
             foreach ($handlersConfig as $handler) {
118
-                $handlers[$handler['type']] = function () use ($handler, $handlerFactory) {
118
+                $handlers[$handler['type']] = function() use ($handler, $handlerFactory) {
119 119
                     $type    = $handler['type'];
120 120
                     $handler = $handlerFactory->create($type);
121 121
                     return $handler;
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
          * @param  Container $container A container instance.
132 132
          * @return LoggerInterface
133 133
          */
134
-        $container['logger'] = function (Container $container) {
134
+        $container['logger'] = function(Container $container) {
135 135
             $loggerConfig = $container['logger/config'];
136 136
 
137 137
             if ($loggerConfig['active'] !== true) {
Please login to merge, or discard this patch.
src/Charcoal/App/ServiceProvider/FilesystemServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
          * @param  Container $container Pimple DI Container.
54 54
          * @return FlysystemConfig
55 55
          */
56
-        $container['filesystem/config'] = function (Container $container) {
56
+        $container['filesystem/config'] = function(Container $container) {
57 57
             $appConfig = isset($container['config']) ? $container['config'] : [];
58 58
             $fsConfig  = isset($appConfig['filesystem']) ? $appConfig['filesystem'] : null;
59 59
             return new FilesystemConfig($fsConfig);
@@ -63,11 +63,11 @@  discard block
 block discarded – undo
63 63
          * @param Container $container Pimple DI Container.
64 64
          * @return MountManager
65 65
          */
66
-        $container['filesystem/manager'] = function () {
66
+        $container['filesystem/manager'] = function() {
67 67
             return new MountManager();
68 68
         };
69 69
 
70
-        $container['filesystems'] = function (Container $container) {
70
+        $container['filesystems'] = function(Container $container) {
71 71
             $filesystemConfig = $container['filesystem/config'];
72 72
             $filesystems = new Container();
73 73
 
Please login to merge, or discard this patch.
src/Charcoal/App/Config/LoggerConfig.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     /**
136 136
      * Add a record handler to use.
137 137
      *
138
-     * @param  array       $handler The record handler structure.
138
+     * @param  string       $handler The record handler structure.
139 139
      * @param  string|null $key     The handler's key.
140 140
      * @throws InvalidArgumentException If the handler is invalid.
141 141
      * @return self
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     /**
198 198
      * Add a record processor to use.
199 199
      *
200
-     * @param  array       $processor The record processor structure.
200
+     * @param  string       $processor The record processor structure.
201 201
      * @param  string|null $key       The processor's key.
202 202
      * @throws InvalidArgumentException If the processor is invalid.
203 203
      * @return self
Please login to merge, or discard this patch.
src/Charcoal/App/ServiceProvider/DatabaseServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@  discard block
 block discarded – undo
43 43
          * @param Container $container A container instance.
44 44
          * @return Container The Collection of DatabaseSourceConfig, in a Container.
45 45
          */
46
-        $container['databases/config'] = function (Container $container) {
46
+        $container['databases/config'] = function(Container $container) {
47 47
             $config = $container['config'];
48 48
             $databases = $config['databases'];
49 49
             $configs = new Container();
50 50
             foreach ($databases as $dbIdent => $dbOptions) {
51
-                $configs[$dbIdent] = function () use ($dbOptions) {
51
+                $configs[$dbIdent] = function() use ($dbOptions) {
52 52
                     return new DatabaseConfig($dbOptions);
53 53
                 };
54 54
             }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
          * @param Container $container A container instance.
60 60
          * @return Container
61 61
          */
62
-        $container['databases'] = function (Container $container) {
62
+        $container['databases'] = function(Container $container) {
63 63
             $config = $container['config'];
64 64
             $databases = $config['databases'];
65 65
             $dbs = new Container();
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                  * @param Container $container A container instance.
72 72
                  * @return PDO
73 73
                  */
74
-                $dbs[$dbIdent] = function () use ($dbIdent, $origContainer) {
74
+                $dbs[$dbIdent] = function() use ($dbIdent, $origContainer) {
75 75
                     $dbConfigs = $origContainer['databases/config'];
76 76
                     $dbConfig = $dbConfigs[$dbIdent];
77 77
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
          * @param Container $container A container instance.
113 113
          * @return DatabaseSourceConfig
114 114
          */
115
-        $container['database/config'] = function (Container $container) {
115
+        $container['database/config'] = function(Container $container) {
116 116
             $config = $container['config'];
117 117
             $databaseIdent = $config['default_database'];
118 118
             return $container['databases/config'][$databaseIdent];
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
          * @throws Exception If the database configuration is invalid.
126 126
          * @return PDO
127 127
          */
128
-        $container['database'] = function (Container $container) {
128
+        $container['database'] = function(Container $container) {
129 129
             $config = $container['config'];
130 130
             $databaseIdent = $config['default_database'];
131 131
             $databases = $container['databases'];
Please login to merge, or discard this patch.
src/Charcoal/App/App.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
     {
164 164
         if (!isset($this->routeManager)) {
165 165
             $config = $this->config();
166
-            $routesConfig = (isset($config['routes']) ? $config['routes'] : [] );
166
+            $routesConfig = (isset($config['routes']) ? $config['routes'] : []);
167 167
 
168 168
             $this->routeManager = new RouteManager([
169 169
                 'config' => $routesConfig,
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         // For now, need to rely on a catch-all...
224 224
         $this->get(
225 225
             '{catchall:.*}',
226
-            function (
226
+            function(
227 227
                 RequestInterface $request,
228 228
                 ResponseInterface $response,
229 229
                 array $args
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,6 @@
 block discarded – undo
18 18
 
19 19
 // From 'charcoal-app'
20 20
 use Charcoal\App\Route\RouteManager;
21
-use Charcoal\App\Route\RouteFactory;
22 21
 
23 22
 /**
24 23
  * Charcoal App
Please login to merge, or discard this patch.
src/Charcoal/App/Route/RouteManager.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -51,17 +51,17 @@  discard block
 block discarded – undo
51 51
         $routes = $this->config();
52 52
 
53 53
         if (PHP_SAPI == 'cli') {
54
-            $scripts = ( isset($routes['scripts']) ? $routes['scripts'] : [] );
54
+            $scripts = (isset($routes['scripts']) ? $routes['scripts'] : []);
55 55
             foreach ($scripts as $scriptIdent => $scriptConfig) {
56 56
                 $this->setupScript($scriptIdent, $scriptConfig);
57 57
             }
58 58
         } else {
59
-            $templates = ( isset($routes['templates']) ? $routes['templates'] : [] );
59
+            $templates = (isset($routes['templates']) ? $routes['templates'] : []);
60 60
             foreach ($templates as $routeIdent => $templateConfig) {
61 61
                 $this->setupTemplate($routeIdent, $templateConfig);
62 62
             }
63 63
 
64
-            $actions = ( isset($routes['actions']) ? $routes['actions'] : [] );
64
+            $actions = (isset($routes['actions']) ? $routes['actions'] : []);
65 65
             foreach ($actions as $actionIdent => $actionConfig) {
66 66
                 $this->setupAction($actionIdent, $actionConfig);
67 67
             }
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 
88 88
         $methods = isset($templateConfig['methods'])
89 89
             ? $templateConfig['methods']
90
-            : [ 'GET' ];
90
+            : ['GET'];
91 91
 
92 92
         $routeHandler = $this->app->map(
93 93
             $methods,
94 94
             $routePattern,
95
-            function (
95
+            function(
96 96
                 RequestInterface $request,
97 97
                 ResponseInterface $response,
98 98
                 array $args = []
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
 
164 164
         $methods = isset($actionConfig['methods'])
165 165
             ? $actionConfig['methods']
166
-            : [ 'POST' ];
166
+            : ['POST'];
167 167
 
168 168
         $routeHandler = $this->app->map(
169 169
             $methods,
170 170
             $routePattern,
171
-            function (
171
+            function(
172 172
                 RequestInterface $request,
173 173
                 ResponseInterface $response,
174 174
                 array $args = []
@@ -239,12 +239,12 @@  discard block
 block discarded – undo
239 239
 
240 240
         $methods = isset($scriptConfig['methods'])
241 241
             ? $scriptConfig['methods']
242
-            : [ 'GET' ];
242
+            : ['GET'];
243 243
 
244 244
         $routeHandler = $this->app->map(
245 245
             $methods,
246 246
             $routePattern,
247
-            function (
247
+            function(
248 248
                 RequestInterface $request,
249 249
                 ResponseInterface $response,
250 250
                 array $args = []
Please login to merge, or discard this patch.
src/Charcoal/App/Script/AbstractScript.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 use Charcoal\Config\AbstractEntity;
25 25
 
26 26
 // From 'charcoal-app'
27
-use Charcoal\App\AppInterface;
28 27
 use Charcoal\App\Script\ScriptInterface;
29 28
 
30 29
 /**
Please login to merge, or discard this patch.
src/Charcoal/App/Route/TemplateRoute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
         $response->getBody()->write($templateContent);
102 102
 
103 103
         if (!empty($config['headers'])) {
104
-            foreach($config['headers'] as $name => $val) {
104
+            foreach ($config['headers'] as $name => $val) {
105 105
                 $response = $response->withHeader($name, $val);
106 106
             }
107 107
         }
Please login to merge, or discard this patch.
src/Charcoal/App/Route/ActionRoute.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 
81 81
         // Set headers if necessary.
82 82
         if (!empty($config['headers'])) {
83
-            foreach($config['headers'] as $name => $val) {
83
+            foreach ($config['headers'] as $name => $val) {
84 84
                 $response = $response->withHeader($name, $val);
85 85
             }
86 86
         }
Please login to merge, or discard this patch.