GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 9c3470...c852c0 )
by
unknown
02:52
created
src/Helpers/Framework.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $args = func_get_args();
56 56
 
57 57
         if ($countArgs = count($args)) {
58
-            if(services()->has('config')) {
58
+            if (services()->has('config')) {
59 59
                 $config = services('config');
60 60
 
61 61
                 if ($countArgs == 1) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      */
83 83
     function cache()
84 84
     {
85
-        if(services()->has('cache')) {
85
+        if (services()->has('cache')) {
86 86
             return services()->get('cache');
87 87
         }
88 88
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     function hooks()
104 104
     {
105
-        if(services()->has('hooks')) {
105
+        if (services()->has('hooks')) {
106 106
             return services()->get('hooks');
107 107
         }
108 108
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $args = func_get_args();
142 142
 
143 143
         if (count($args)) {
144
-            return o2system()->models->get($args[ 0 ]);
144
+            return o2system()->models->get($args[0]);
145 145
         }
146 146
 
147 147
         return o2system()->models;
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         $args = func_get_args();
164 164
 
165 165
         if (count($args)) {
166
-            return o2system()->modules->getModule($args[ 0 ]);
166
+            return o2system()->modules->getModule($args[0]);
167 167
         }
168 168
 
169 169
         return o2system()->modules;
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
         $args = func_get_args();
202 202
 
203 203
         if (count($args)) {
204
-            if(isset($_SESSION[ $args[0] ])) {
205
-                return $_SESSION[ $args[0] ];
204
+            if (isset($_SESSION[$args[0]])) {
205
+                return $_SESSION[$args[0]];
206 206
             }
207 207
 
208 208
             return null;
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         $args = func_get_args();
244 244
 
245 245
         if (count($args)) {
246
-            if(services()->has('view')) {
246
+            if (services()->has('view')) {
247 247
                 $view = services('view');
248 248
 
249 249
                 return call_user_func_array([&$view, 'load'], $args);
Please login to merge, or discard this patch.
src/Containers/Models.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,9 +37,9 @@
 block discarded – undo
37 37
     public function __construct()
38 38
     {
39 39
         if ($config = config()->loadFile('database', true)) {
40
-            if ( ! empty($config[ 'default' ][ 'hostname' ]) AND ! empty($config[ 'default' ][ 'username' ])) {
40
+            if ( ! empty($config['default']['hostname']) AND ! empty($config['default']['username'])) {
41 41
 
42
-                if(profiler() !== false) {
42
+                if (profiler() !== false) {
43 43
                     profiler()->watch('Starting Database Service');
44 44
                 }
45 45
 
Please login to merge, or discard this patch.
src/Containers/Modules.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function push($module)
100 100
     {
101
-        if (!in_array($module->getNamespace(), ['O2System\Kernel\\', 'O2System\Framework\\', 'App\\'])) {
101
+        if ( ! in_array($module->getNamespace(), ['O2System\Kernel\\', 'O2System\Framework\\', 'App\\'])) {
102 102
             $this->autoload($module);
103 103
 
104 104
             parent::push($module);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $this->autoloadHelpers($module);
116 116
 
117
-        if (!in_array($module->getType(), ['KERNEL', 'FRAMEWORK'])) {
117
+        if ( ! in_array($module->getType(), ['KERNEL', 'FRAMEWORK'])) {
118 118
             // Add Public Dir
119 119
             loader()->addPublicDir($module->getPublicDir());
120 120
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
      */
360 360
     public function loadRegistry()
361 361
     {
362
-        if(empty($this->registry)) {
362
+        if (empty($this->registry)) {
363 363
             $cacheItemPool = cache()->getItemPool('default');
364 364
 
365 365
             if (cache()->hasItemPool('registry')) {
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
                             ->setIndent(2)
435 435
                             ->setNewLinesAfter(1)
436 436
                     );
437
-                } elseif (!is_array($packageJsonMetadata)) {
437
+                } elseif ( ! is_array($packageJsonMetadata)) {
438 438
                     continue;
439 439
                 }
440 440
 
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                     )
465 465
                 );
466 466
 
467
-                $moduleSegments = array_map(function ($string) {
467
+                $moduleSegments = array_map(function($string) {
468 468
                     return dash(snakecase($string));
469 469
                 }, $moduleSegments);
470 470
 
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
     {
543 543
         $pluralTypes = plural(strtolower($type));
544 544
 
545
-        if (!in_array($pluralTypes, $this->types)) {
545
+        if ( ! in_array($pluralTypes, $this->types)) {
546 546
             array_push($this->types, $pluralTypes);
547 547
         }
548 548
 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
     {
687 687
         $segments = is_array($segments) ? implode('/', $segments) : $segments;
688 688
 
689
-        if(is_string($segments)) {
689
+        if (is_string($segments)) {
690 690
             return (bool)array_key_exists($segments, $this->registry);
691 691
         }
692 692
 
Please login to merge, or discard this patch.
src/Cli/Commanders/Make/Theme.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function optionName($name)
40 40
     {
41
-        if(empty($this->optionPath)) {
41
+        if (empty($this->optionPath)) {
42 42
             $this->optionPath = PATH_RESOURCES . 'themes' . DIRECTORY_SEPARATOR;
43 43
         }
44 44
 
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
         // Make default structure
79 79
         mkdir($themePath . 'assets' . DIRECTORY_SEPARATOR, 0777, true);
80 80
 
81
-        foreach(['css','js', 'img', 'fonts', 'media', 'packages'] as $assetsDir) {
81
+        foreach (['css', 'js', 'img', 'fonts', 'media', 'packages'] as $assetsDir) {
82 82
             mkdir($themePath . 'assets' . DIRECTORY_SEPARATOR . $assetsDir . DIRECTORY_SEPARATOR, 0777, true);
83 83
         }
84 84
 
85 85
         mkdir($themePath . 'partials' . DIRECTORY_SEPARATOR, 0777, true);
86 86
 
87
-        $jsProps[ 'name' ] = readable(
87
+        $jsProps['name'] = readable(
88 88
             $this->optionName,
89 89
             true
90 90
         );
91 91
 
92
-        $jsProps[ 'created' ] = date('d M Y');
92
+        $jsProps['created'] = date('d M Y');
93 93
 
94 94
         file_put_contents($themePath . 'theme.jsprop', json_encode($jsProps, JSON_PRETTY_PRINT));
95 95
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 </html>
111 111
 THEME;
112 112
 
113
-        file_put_contents($themePath . 'theme.phtml', str_replace('@','$',$themeTemplate));
113
+        file_put_contents($themePath . 'theme.phtml', str_replace('@', '$', $themeTemplate));
114 114
 
115 115
         if (is_dir($themePath)) {
116 116
             output()->write(
Please login to merge, or discard this patch.
src/Datastructures/Module/Theme.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
             $properties = json_decode(file_get_contents($propFilePath), true);
63 63
 
64 64
             if (json_last_error() === JSON_ERROR_NONE) {
65
-                if(isset($properties['config'])) {
65
+                if (isset($properties['config'])) {
66 66
                     $this->presets = $properties['presets'];
67 67
                     unset($properties['presets']);
68 68
                 }
@@ -157,10 +157,10 @@  discard block
 block discarded – undo
157 157
     {
158 158
         $extensions = ['.php', '.phtml', '.html', '.tpl'];
159 159
 
160
-        if (isset($this->presets[ 'extensions' ])) {
161
-            array_unshift($partialsExtensions, $this->presets[ 'extension' ]);
162
-        } elseif (isset($this->presets[ 'extension' ])) {
163
-            array_unshift($extensions, $this->presets[ 'extension' ]);
160
+        if (isset($this->presets['extensions'])) {
161
+            array_unshift($partialsExtensions, $this->presets['extension']);
162
+        } elseif (isset($this->presets['extension'])) {
163
+            array_unshift($extensions, $this->presets['extension']);
164 164
         }
165 165
 
166 166
         foreach ($extensions as $extension) {
Please login to merge, or discard this patch.
src/Framework.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -359,12 +359,12 @@
 block discarded – undo
359 359
                 $session->set('language', language()->getDefault());
360 360
             }
361 361
 
362
-            if (config('security')->protection[ 'csrf' ] === true) {
362
+            if (config('security')->protection['csrf'] === true) {
363 363
                 $csrfProtection = new Security\Protections\Csrf();
364 364
                 $this->services->add($csrfProtection, 'csrfProtection');
365 365
             }
366 366
 
367
-            if (config('security')->protection[ 'xss' ] === true) {
367
+            if (config('security')->protection['xss'] === true) {
368 368
                 $csrfProtection = new Security\Protections\Xss();
369 369
                 $this->services->add($xssProtection, 'xssProtection');
370 370
             }
Please login to merge, or discard this patch.
src/Services/Loader.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -141,20 +141,20 @@  discard block
 block discarded – undo
141 141
 
142 142
         if (is_dir($baseDirectory)) {
143 143
             // initialize the namespace prefix array
144
-            if (isset($this->namespaceDirs[ $namespace ]) === false) {
145
-                $this->namespaceDirs[ $namespace ] = [];
144
+            if (isset($this->namespaceDirs[$namespace]) === false) {
145
+                $this->namespaceDirs[$namespace] = [];
146 146
             }
147 147
 
148 148
             // retain the base directory for the namespace prefix
149
-            if ( ! in_array($baseDirectory, $this->namespaceDirs[ $namespace ])) {
149
+            if ( ! in_array($baseDirectory, $this->namespaceDirs[$namespace])) {
150 150
                 if ($prepend) {
151
-                    array_unshift($this->namespaceDirs[ $namespace ], $baseDirectory);
151
+                    array_unshift($this->namespaceDirs[$namespace], $baseDirectory);
152 152
                 } else {
153
-                    array_push($this->namespaceDirs[ $namespace ], $baseDirectory);
153
+                    array_push($this->namespaceDirs[$namespace], $baseDirectory);
154 154
                 }
155 155
             }
156 156
 
157
-            $this->namespaceDirsMap[ $baseDirectory ] = $namespace;
157
+            $this->namespaceDirsMap[$baseDirectory] = $namespace;
158 158
 
159 159
             // Register Namespace Language
160 160
             language()->addFilePath($baseDirectory);
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
         if (is_dir($publicDir) and ! in_array($publicDir, $this->publicDirs)) {
194 194
             if (isset($offset)) {
195
-                $this->publicDirs[ $offset ] = $publicDir;
195
+                $this->publicDirs[$offset] = $publicDir;
196 196
             } else {
197 197
                 $this->publicDirs[] = $publicDir;
198 198
             }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
         if (is_dir($resourcesDir) and ! in_array($resourcesDir, $this->resourcesDirs)) {
219 219
             if (isset($offset)) {
220
-                $this->resourcesDirs[ $offset ] = $resourcesDir;
220
+                $this->resourcesDirs[$offset] = $resourcesDir;
221 221
             } else {
222 222
                 $this->resourcesDirs[] = $resourcesDir;
223 223
             }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
         $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
276 276
 
277 277
         if (array_key_exists($dir, $this->namespaceDirsMap)) {
278
-            return $this->namespaceDirsMap[ $dir ];
278
+            return $this->namespaceDirsMap[$dir];
279 279
         }
280 280
 
281 281
         return false;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
         $namespace = trim($namespace, '\\') . '\\';
317 317
 
318 318
         if (array_key_exists($namespace, $this->namespaceDirs)) {
319
-            return $this->namespaceDirs[ $namespace ];
319
+            return $this->namespaceDirs[$namespace];
320 320
         }
321 321
 
322 322
         return false;
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
         }
340 340
 
341 341
         if ($this->requireFile($helper)) {
342
-            $this->loadedHelpers[ pathinfo($helper, PATHINFO_FILENAME) ][] = $helper;
342
+            $this->loadedHelpers[pathinfo($helper, PATHINFO_FILENAME)][] = $helper;
343 343
 
344 344
             return;
345 345
         }
@@ -355,17 +355,17 @@  discard block
 block discarded – undo
355 355
         }
356 356
 
357 357
         if ( ! array_key_exists($helper, $this->loadedHelpers)) {
358
-            $this->loadedHelpers[ $helper ] = [];
358
+            $this->loadedHelpers[$helper] = [];
359 359
         }
360 360
 
361 361
         foreach ($helperDirectories as $helperDirectory) {
362 362
 
363 363
             $helperFilePath = $helperDirectory . studlycase($helper) . '.php';
364 364
 
365
-            if (in_array($helperFilePath, $this->loadedHelpers[ $helper ])) {
365
+            if (in_array($helperFilePath, $this->loadedHelpers[$helper])) {
366 366
                 continue;
367 367
             } elseif ($this->requireFile($helperFilePath)) {
368
-                $this->loadedHelpers[ $helper ][] = $helperFilePath;
368
+                $this->loadedHelpers[$helper][] = $helperFilePath;
369 369
             }
370 370
         }
371 371
     }
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
             if (false !== ($modules = modules()->getRegistry())) {
397 397
                 foreach ($modules as $module) {
398 398
                     if ($module instanceof Module) {
399
-                        if (empty($this->namespaceDirs[ $module->getNamespace() ])) {
399
+                        if (empty($this->namespaceDirs[$module->getNamespace()])) {
400 400
                             $this->addNamespace($module->getNamespace(), $module->getRealPath());
401 401
                         }
402 402
                     }
@@ -458,12 +458,12 @@  discard block
 block discarded – undo
458 458
     public function loadMappedFile($namespace, $relativeClass)
459 459
     {
460 460
         // are there any base directories for this namespace prefix?
461
-        if (isset($this->namespaceDirs[ $namespace ]) === false) {
461
+        if (isset($this->namespaceDirs[$namespace]) === false) {
462 462
             return false;
463 463
         }
464 464
 
465 465
         // look through base directories for this namespace prefix
466
-        foreach ($this->namespaceDirs[ $namespace ] as $namespaceDirectory) {
466
+        foreach ($this->namespaceDirs[$namespace] as $namespaceDirectory) {
467 467
 
468 468
             // replace the namespace prefix with the base directory,
469 469
             // replace namespace separators with directory separators
@@ -528,9 +528,9 @@  discard block
 block discarded – undo
528 528
     public function services(array $classes)
529 529
     {
530 530
         foreach ($classes as $name => $class) {
531
-            if(is_numeric($name)) {
531
+            if (is_numeric($name)) {
532 532
                 services()->load($class);
533
-            } elseif(is_string($name)) {
533
+            } elseif (is_string($name)) {
534 534
                 services()->load($class, $name);
535 535
             }
536 536
         }
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 
548 548
     public function models(array $models)
549 549
     {
550
-        foreach($models as $model) {
550
+        foreach ($models as $model) {
551 551
             models()->load($model);
552 552
         }
553 553
     }
Please login to merge, or discard this patch.
src/Services/Language.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      */
60 60
     public function loadRegistry()
61 61
     {
62
-        if(empty($this->registry)) {
62
+        if (empty($this->registry)) {
63 63
             $cacheItemPool = cache()->getItemPool('default');
64 64
 
65 65
             if (cache()->hasItemPool('registry')) {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                             );
126 126
                         }
127 127
 
128
-                        $registry[ $package->getDirName() ] = $package;
128
+                        $registry[$package->getDirName()] = $package;
129 129
                     } elseif (is_cli()) {
130 130
                         output()->verbose(
131 131
                             (new Format())
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     public function registered($package)
157 157
     {
158
-        return isset($this->registry[ $package ]);
158
+        return isset($this->registry[$package]);
159 159
     }
160 160
 
161 161
     // ------------------------------------------------------------------------
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     {
172 172
         if (isset($package)) {
173 173
             if ($this->registered($package)) {
174
-                return $this->registry[ $package ];
174
+                return $this->registry[$package];
175 175
             }
176 176
 
177 177
             return false;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
     public function getDefaultMetadata()
184 184
     {
185
-        return $this->getRegistry( $this->getDefault() );
185
+        return $this->getRegistry($this->getDefault());
186 186
     }
187 187
 
188 188
     // ------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/Models/Files/Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             }
40 40
 
41 41
             $first = reset($this->storage);
42
-            if ( ! isset($first[ $this->primaryKey ])) {
42
+            if ( ! isset($first[$this->primaryKey])) {
43 43
                 $keys = $first->getKeys();
44 44
                 $this->primaryKey = reset($keys);
45 45
             }
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 
49 49
     public function get($property)
50 50
     {
51
-        if (empty($get[ $property ])) {
51
+        if (empty($get[$property])) {
52 52
             if (services()->has($property)) {
53 53
                 return services()->get($property);
54 54
             } elseif (array_key_exists($property, $this->validSubModels)) {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
     final protected function loadSubModel($model)
65 65
     {
66
-        if (is_file($this->validSubModels[ $model ])) {
66
+        if (is_file($this->validSubModels[$model])) {
67 67
             $className = '\\' . get_called_class() . '\\' . ucfirst($model);
68 68
             $className = str_replace('\Base\\Model', '\Models', $className);
69 69
 
Please login to merge, or discard this patch.