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
Branch master (9c3470)
by O2System
04:07
created
src/Framework.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
         $this->addService($hooks);
205 205
 
206 206
         if ($config = config()->loadFile('database', true)) {
207
-            if ( ! empty($config[ 'default' ][ 'hostname' ]) AND ! empty($config[ 'default' ][ 'username' ])) {
207
+            if ( ! empty($config['default']['hostname']) AND ! empty($config['default']['username'])) {
208 208
 
209 209
                 // Instantiate Database Connection Pools
210 210
                 profiler()->watch('INSTANTIATE_DATABASE_CONNECTION_POOLS');
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
             $this->addService($session);
386 386
 
387
-            if($session->has('language')) {
387
+            if ($session->has('language')) {
388 388
                 language()->setDefault($session->get('language'));
389 389
             } else {
390 390
                 $session->set('language', language()->getDefault());
Please login to merge, or discard this patch.
src/Services/Cache.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 
201 201
         foreach ($keys as $key) {
202 202
             if ($this->exists($key)) {
203
-                $result[ $key ] = $this->get($key, $default);
203
+                $result[$key] = $this->get($key, $default);
204 204
             }
205 205
         }
206 206
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
         foreach ($values as $key => $value) {
310 310
             if ($this->set($key, $value, $ttl)) {
311
-                $result[ $key ] = true;
311
+                $result[$key] = true;
312 312
             }
313 313
         }
314 314
 
Please login to merge, or discard this patch.
src/Services/Logger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
     public function __construct()
27 27
     {
28 28
         $config = config()->get('logger');
29
-        $config[ 'path' ] = PATH_CACHE . 'log' . DIRECTORY_SEPARATOR;
29
+        $config['path'] = PATH_CACHE . 'log' . DIRECTORY_SEPARATOR;
30 30
 
31 31
         parent::__construct(new Config($config));
32 32
     }
Please login to merge, or discard this patch.
src/Services/Language.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                         );
128 128
                     }
129 129
 
130
-                    $registry[ $package->getDirName() ] = $package;
130
+                    $registry[$package->getDirName()] = $package;
131 131
                 } elseif (is_cli()) {
132 132
                     output()->verbose(
133 133
                         (new Format())
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function registered($package)
158 158
     {
159
-        return isset($this->registry[ $package ]);
159
+        return isset($this->registry[$package]);
160 160
     }
161 161
 
162 162
     // ------------------------------------------------------------------------
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
     {
173 173
         if (isset($package)) {
174 174
             if ($this->registered($package)) {
175
-                return $this->registry[ $package ];
175
+                return $this->registry[$package];
176 176
             }
177 177
 
178 178
             return false;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
 
184 184
     public function getDefaultMetadata()
185 185
     {
186
-        return $this->getRegistry( $this->getDefault() );
186
+        return $this->getRegistry($this->getDefault());
187 187
     }
188 188
 
189 189
     // ------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/Services/Loader.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -129,20 +129,20 @@  discard block
 block discarded – undo
129 129
 
130 130
         if (is_dir($baseDirectory)) {
131 131
             // initialize the namespace prefix array
132
-            if (isset($this->namespaceDirs[ $namespace ]) === false) {
133
-                $this->namespaceDirs[ $namespace ] = [];
132
+            if (isset($this->namespaceDirs[$namespace]) === false) {
133
+                $this->namespaceDirs[$namespace] = [];
134 134
             }
135 135
 
136 136
             // retain the base directory for the namespace prefix
137
-            if ( ! in_array($baseDirectory, $this->namespaceDirs[ $namespace ])) {
137
+            if ( ! in_array($baseDirectory, $this->namespaceDirs[$namespace])) {
138 138
                 if ($prepend) {
139
-                    array_unshift($this->namespaceDirs[ $namespace ], $baseDirectory);
139
+                    array_unshift($this->namespaceDirs[$namespace], $baseDirectory);
140 140
                 } else {
141
-                    array_push($this->namespaceDirs[ $namespace ], $baseDirectory);
141
+                    array_push($this->namespaceDirs[$namespace], $baseDirectory);
142 142
                 }
143 143
             }
144 144
 
145
-            $this->namespaceDirsMap[ $baseDirectory ] = $namespace;
145
+            $this->namespaceDirsMap[$baseDirectory] = $namespace;
146 146
 
147 147
             // Register Namespace Language
148 148
             language()->addFilePath($baseDirectory);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
         if (is_dir($publicDir) and ! in_array($publicDir, $this->publicDirs)) {
182 182
             if (isset($offset)) {
183
-                $this->publicDirs[ $offset ] = $publicDir;
183
+                $this->publicDirs[$offset] = $publicDir;
184 184
             } else {
185 185
                 $this->publicDirs[] = $publicDir;
186 186
             }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         $dir = rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
223 223
 
224 224
         if (array_key_exists($dir, $this->namespaceDirsMap)) {
225
-            return $this->namespaceDirsMap[ $dir ];
225
+            return $this->namespaceDirsMap[$dir];
226 226
         }
227 227
 
228 228
         return false;
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         $namespace = trim($namespace, '\\') . '\\';
264 264
 
265 265
         if (array_key_exists($namespace, $this->namespaceDirs)) {
266
-            return $this->namespaceDirs[ $namespace ];
266
+            return $this->namespaceDirs[$namespace];
267 267
         }
268 268
 
269 269
         return false;
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         }
287 287
 
288 288
         if ($this->requireFile($helper)) {
289
-            $this->loadedHelpers[ pathinfo($helper, PATHINFO_FILENAME) ][] = $helper;
289
+            $this->loadedHelpers[pathinfo($helper, PATHINFO_FILENAME)][] = $helper;
290 290
 
291 291
             return;
292 292
         }
@@ -302,17 +302,17 @@  discard block
 block discarded – undo
302 302
         }
303 303
 
304 304
         if ( ! array_key_exists($helper, $this->loadedHelpers)) {
305
-            $this->loadedHelpers[ $helper ] = [];
305
+            $this->loadedHelpers[$helper] = [];
306 306
         }
307 307
 
308 308
         foreach ($helperDirectories as $helperDirectory) {
309 309
 
310 310
             $helperFilePath = $helperDirectory . studlycase($helper) . '.php';
311 311
 
312
-            if (in_array($helperFilePath, $this->loadedHelpers[ $helper ])) {
312
+            if (in_array($helperFilePath, $this->loadedHelpers[$helper])) {
313 313
                 continue;
314 314
             } elseif ($this->requireFile($helperFilePath)) {
315
-                $this->loadedHelpers[ $helper ][] = $helperFilePath;
315
+                $this->loadedHelpers[$helper][] = $helperFilePath;
316 316
             }
317 317
         }
318 318
     }
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
             if (false !== ($modules = modules()->getRegistry())) {
344 344
                 foreach ($modules as $module) {
345 345
                     if ($module instanceof Module) {
346
-                        if (empty($this->namespaceDirs[ $module->getNamespace() ])) {
346
+                        if (empty($this->namespaceDirs[$module->getNamespace()])) {
347 347
                             $this->addNamespace($module->getNamespace(), $module->getRealPath());
348 348
                         }
349 349
                     }
@@ -405,12 +405,12 @@  discard block
 block discarded – undo
405 405
     public function loadMappedFile($namespace, $relativeClass)
406 406
     {
407 407
         // are there any base directories for this namespace prefix?
408
-        if (isset($this->namespaceDirs[ $namespace ]) === false) {
408
+        if (isset($this->namespaceDirs[$namespace]) === false) {
409 409
             return false;
410 410
         }
411 411
 
412 412
         // look through base directories for this namespace prefix
413
-        foreach ($this->namespaceDirs[ $namespace ] as $namespaceDirectory) {
413
+        foreach ($this->namespaceDirs[$namespace] as $namespaceDirectory) {
414 414
 
415 415
             // replace the namespace prefix with the base directory,
416 416
             // replace namespace separators with directory separators
@@ -475,9 +475,9 @@  discard block
 block discarded – undo
475 475
     public function services(array $classes)
476 476
     {
477 477
         foreach ($classes as $name => $class) {
478
-            if(is_numeric($name)) {
478
+            if (is_numeric($name)) {
479 479
                 o2system()->addService($class);
480
-            } elseif(is_string($name)) {
480
+            } elseif (is_string($name)) {
481 481
                 o2system()->addService($class, $name);
482 482
             }
483 483
         }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 
495 495
     public function models(array $models)
496 496
     {
497
-        foreach($models as $model) {
497
+        foreach ($models as $model) {
498 498
             models()->load($model);
499 499
         }
500 500
     }
Please login to merge, or discard this patch.
src/Services/Hooks.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -78,14 +78,14 @@
 block discarded – undo
78 78
             'POST_CONTROLLER',
79 79
             'POST_COMMANDER',
80 80
         ])) {
81
-            $this->closures[ $event ][] = $closure;
81
+            $this->closures[$event][] = $closure;
82 82
         }
83 83
     }
84 84
 
85 85
     public function callEvent($event)
86 86
     {
87 87
         if (array_key_exists($event, $this->closures)) {
88
-            foreach ($this->closures[ $event ] as $closure) {
88
+            foreach ($this->closures[$event] as $closure) {
89 89
                 call_user_func($closure);
90 90
             }
91 91
         }
Please login to merge, or discard this patch.
src/Models/Files/Traits/FinderTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 $item = new SplArrayObject();
52 52
                 foreach ($fields as $field) {
53 53
                     if ($row->offsetExists($field)) {
54
-                        $item[ $field ] = $row->offsetGet($field);
54
+                        $item[$field] = $row->offsetGet($field);
55 55
                     }
56 56
                 }
57 57
 
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
         $chunks = array_chunk($this->storage, $entries);
78 78
         $offset = $page - 1;
79 79
 
80
-        if (isset($chunks[ $offset ])) {
81
-            $result = new ArrayIterator($chunks[ $offset ]);
80
+        if (isset($chunks[$offset])) {
81
+            $result = new ArrayIterator($chunks[$offset]);
82 82
 
83 83
             if (empty($fields)) {
84 84
                 return $this->result = $result;
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                     $item = new SplArrayObject();
88 88
                     foreach ($fields as $field) {
89 89
                         if ($row->offsetExists($field)) {
90
-                            $item[ $field ] = $row->offsetGet($field);
90
+                            $item[$field] = $row->offsetGet($field);
91 91
                         }
92 92
                     }
93 93
 
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 (o2system()->hasService($property)) {
53 53
                 return o2system()->getService($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.
src/Models/Options.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
         $familyRelationships = [];
171 171
 
172 172
         foreach ([
173
-                     'PARENT',
174
-                     'CHILD',
175
-                     'SPOUSE',
176
-                     'SIBLING',
177
-                     'GRANDPARENTS',
178
-                     'GRANDCHILD',
179
-                     'PARENTS_SIBLING',
180
-                     'SIBLINGS_CHILD',
181
-                     'AUNTS_UNCLES_CHILD',
182
-                 ] as $relationship
173
+                        'PARENT',
174
+                        'CHILD',
175
+                        'SPOUSE',
176
+                        'SIBLING',
177
+                        'GRANDPARENTS',
178
+                        'GRANDCHILD',
179
+                        'PARENTS_SIBLING',
180
+                        'SIBLINGS_CHILD',
181
+                        'AUNTS_UNCLES_CHILD',
182
+                    ] as $relationship
183 183
         ) {
184 184
             $familyRelationships[ $relationship ]  = $this->language->getLine($relationship);
185 185
         }
@@ -192,12 +192,12 @@  discard block
 block discarded – undo
192 192
         $statuses = [];
193 193
 
194 194
         foreach ([
195
-                     'PUBLISH',
196
-                     'UNPUBLISH',
197
-                     'DRAFT',
198
-                     'ARCHIVED',
199
-                     'TRASH'
200
-                 ] as $status
195
+                        'PUBLISH',
196
+                        'UNPUBLISH',
197
+                        'DRAFT',
198
+                        'ARCHIVED',
199
+                        'TRASH'
200
+                    ] as $status
201 201
         ) {
202 202
             $statuses[ $status ]  = $this->language->getLine($status);
203 203
         }
@@ -210,10 +210,10 @@  discard block
 block discarded – undo
210 210
         $visibilities = [];
211 211
 
212 212
         foreach ([
213
-                     'PUBLIC',
214
-                     'PRIVATE',
215
-                     'MEMBER',
216
-                 ] as $visibility
213
+                        'PUBLIC',
214
+                        'PRIVATE',
215
+                        'MEMBER',
216
+                    ] as $visibility
217 217
         ) {
218 218
             $visibilities[ $visibility ]  = $this->language->getLine($visibility);
219 219
         }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         $religions = [];
35 35
 
36 36
         foreach (['ATHEIST', 'HINDU', 'BUDDHA', 'MOSLEM', 'CHRISTIAN', 'CATHOLIC', 'UNDEFINED'] as $religion) {
37
-            $religions[ $religion ] = $this->language->getLine($religion);
37
+            $religions[$religion] = $this->language->getLine($religion);
38 38
         }
39 39
 
40 40
         return $religions;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $genders = [];
46 46
 
47 47
         foreach (['MALE', 'FEMALE', 'UNDEFINED'] as $gender) {
48
-            $genders[ $gender ] = $this->language->getLine($gender);
48
+            $genders[$gender] = $this->language->getLine($gender);
49 49
         }
50 50
 
51 51
         return $genders;
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $maritals = [];
57 57
 
58 58
         foreach (['SINGLE', 'MARRIED', 'DIVORCED', 'UNDEFINED'] as $marital) {
59
-            $maritals[ $marital ] = $this->language->getLine($marital);
59
+            $maritals[$marital] = $this->language->getLine($marital);
60 60
         }
61 61
 
62 62
         return $maritals;
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $bloodTypes = [];
68 68
 
69 69
         foreach (['A', 'B', 'AB', 'O', 'UNDEFINED'] as $bloodType) {
70
-            $bloodTypes[ $bloodType ] = $this->language->getLine($bloodType);
70
+            $bloodTypes[$bloodType] = $this->language->getLine($bloodType);
71 71
         }
72 72
 
73 73
         return $bloodTypes;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 
85 85
         for ($i = $start; $i <= $end; $i++) {
86 86
             $time = strtotime($year . 'W' . $week . $i);
87
-            $days[ strtoupper(date('D', $time)) ] = $this->language->getLine(
87
+            $days[strtoupper(date('D', $time))] = $this->language->getLine(
88 88
                 'CAL_' . strtoupper(date($labelFormat, $time)));
89 89
         }
90 90
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             if ($leading) {
100 100
                 $date = strlen($date) == 1 ? '0' . $date : $date;
101 101
             }
102
-            $dates[ $date ] = $date;
102
+            $dates[$date] = $date;
103 103
         }
104 104
 
105 105
         return $dates;
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             if ($leading) {
116 116
                 $month = strlen($month) == 1 ? '0' . $month : $month;
117 117
             }
118
-            $months[ $month ] = $this->language->getLine(strtoupper('CAL_' . date('F',
118
+            $months[$month] = $this->language->getLine(strtoupper('CAL_' . date('F',
119 119
                     strtotime('1-' . $month . '-2000'))));
120 120
         }
121 121
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $years = [];
129 129
 
130 130
         foreach (range($start, $end) as $year) {
131
-            $years[ $year ] = $year;
131
+            $years[$year] = $year;
132 132
         }
133 133
 
134 134
         return $years;
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         $identities = [];
140 140
 
141 141
         foreach (['UNDEFINED', 'IDENTITY_CARD', 'STUDENT_CARD', 'DRIVER_LICENSE', 'PASSPORT'] as $identity) {
142
-            $identities[ $identity ] = $this->language->getLine($identity);
142
+            $identities[$identity] = $this->language->getLine($identity);
143 143
         }
144 144
 
145 145
         return $identities;
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     {
150 150
         $sizes = [];
151 151
         foreach (['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'] as $size) {
152
-            $sizes[ $size ] = $size;
152
+            $sizes[$size] = $size;
153 153
         }
154 154
 
155 155
         return $sizes;
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
     {
160 160
         $boolean = [];
161 161
         foreach (['YES', 'NO'] as $bool) {
162
-            $boolean[ $bool ] = $this->language->getLine( 'BOOL_' . $bool);
162
+            $boolean[$bool] = $this->language->getLine('BOOL_' . $bool);
163 163
         }
164 164
 
165 165
         return $boolean;
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
                      'AUNTS_UNCLES_CHILD',
182 182
                  ] as $relationship
183 183
         ) {
184
-            $familyRelationships[ $relationship ]  = $this->language->getLine($relationship);
184
+            $familyRelationships[$relationship] = $this->language->getLine($relationship);
185 185
         }
186 186
 
187 187
         return $familyRelationships;
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                      'TRASH'
200 200
                  ] as $status
201 201
         ) {
202
-            $statuses[ $status ]  = $this->language->getLine($status);
202
+            $statuses[$status] = $this->language->getLine($status);
203 203
         }
204 204
 
205 205
         return $statuses;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                      'MEMBER',
216 216
                  ] as $visibility
217 217
         ) {
218
-            $visibilities[ $visibility ]  = $this->language->getLine($visibility);
218
+            $visibilities[$visibility] = $this->language->getLine($visibility);
219 219
         }
220 220
 
221 221
         return $visibilities;
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
     {
226 226
         $languages = [];
227 227
 
228
-        foreach($this->language->getRegistry() as $language) {
229
-            $languages[ $language->getParameter() ] = $language->getProperties()->name;
228
+        foreach ($this->language->getRegistry() as $language) {
229
+            $languages[$language->getParameter()] = $language->getProperties()->name;
230 230
         }
231 231
 
232 232
         return $languages;
Please login to merge, or discard this patch.