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 ( ae9f57...8a0092 )
by Steeven
02:24
created
src/Models/Sql/Traits/HierarchicalTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                         ]);
86 86
                 }
87 87
 
88
-                $update[ $this->primaryKey ] = $child->{$this->primaryKey};
88
+                $update[$this->primaryKey] = $child->{$this->primaryKey};
89 89
 
90 90
                 if ($this->qb
91 91
                     ->table($this->table)
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                         ->update($update = [
101 101
                             'record_right' => $right,
102 102
                         ]);
103
-                    $update[ $this->primaryKey ] = $child->{$this->primaryKey};
103
+                    $update[$this->primaryKey] = $child->{$this->primaryKey};
104 104
                 }
105 105
 
106 106
                 $i++;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
             ->select($this->table . '.*')
257 257
             ->from($this->table)
258 258
             ->from($this->table . ' AS node')
259
-            ->whereBetween($this->table . '.record_left', [ 'node.record_left', 'node.record_right'])
259
+            ->whereBetween($this->table . '.record_left', ['node.record_left', 'node.record_right'])
260 260
             ->where([
261 261
                 'node.' . $this->primaryKey => $id,
262 262
                 $this->table . '.' . $this->primaryKey . '!=' => $id,
Please login to merge, or discard this patch.
src/Containers/Modules/DataStructures/Module/Theme.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@  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' ])) {
66
-                    $this->presets = $properties[ 'presets' ];
67
-                    unset($properties[ 'presets' ]);
65
+                if (isset($properties['config'])) {
66
+                    $this->presets = $properties['presets'];
67
+                    unset($properties['presets']);
68 68
                 }
69 69
 
70 70
                 $this->properties = $properties;
@@ -198,10 +198,10 @@  discard block
 block discarded – undo
198 198
     {
199 199
         $extensions = ['.php', '.phtml', '.html', '.tpl'];
200 200
 
201
-        if (isset($this->presets[ 'extensions' ])) {
202
-            array_unshift($partialsExtensions, $this->presets[ 'extension' ]);
203
-        } elseif (isset($this->presets[ 'extension' ])) {
204
-            array_unshift($extensions, $this->presets[ 'extension' ]);
201
+        if (isset($this->presets['extensions'])) {
202
+            array_unshift($partialsExtensions, $this->presets['extension']);
203
+        } elseif (isset($this->presets['extension'])) {
204
+            array_unshift($extensions, $this->presets['extension']);
205 205
         }
206 206
 
207 207
         $found = false;
@@ -253,10 +253,10 @@  discard block
 block discarded – undo
253 253
         if (isset($layout)) {
254 254
             $extensions = ['.php', '.phtml', '.html', '.tpl'];
255 255
 
256
-            if (isset($this->presets[ 'extensions' ])) {
257
-                array_unshift($partialsExtensions, $this->presets[ 'extension' ]);
258
-            } elseif (isset($this->presets[ 'extension' ])) {
259
-                array_unshift($extensions, $this->presets[ 'extension' ]);
256
+            if (isset($this->presets['extensions'])) {
257
+                array_unshift($partialsExtensions, $this->presets['extension']);
258
+            } elseif (isset($this->presets['extension'])) {
259
+                array_unshift($extensions, $this->presets['extension']);
260 260
             }
261 261
 
262 262
             foreach ($extensions as $extension) {
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         if ($this->layout instanceof Theme\Layout) {
291 291
             
292 292
             // load parent theme layout
293
-            if($this->layout->getFilename() !== 'theme') {
293
+            if ($this->layout->getFilename() !== 'theme') {
294 294
                 $themeLayout = $this->getLayout('theme');
295 295
                 
296 296
                 // add theme layout public directory
Please login to merge, or discard this patch.
src/Models/Sql/Traits/ModifierTrait.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
             if (count($this->fillableColumns)) {
41 41
                 foreach ($sets as $key => $value) {
42 42
                     if ( ! in_array($key, $this->fillableColumns)) {
43
-                        unset($sets[ $key ]);
43
+                        unset($sets[$key]);
44 44
                     }
45 45
                 }
46 46
             }
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
             }
55 55
 
56 56
             if (method_exists($this, 'getRecordOrdering')) {
57
-                if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) {
58
-                    $sets[ 'record_ordering' ] = $this->getRecordOrdering();
57
+                if ($this->recordOrdering === true && empty($sets['record_ordering'])) {
58
+                    $sets['record_ordering'] = $this->getRecordOrdering();
59 59
                 }
60 60
             }
61 61
 
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 if ($files = input()->files()) {
71 71
                     // Uploaded Image Process
72 72
                     if (isset($this->uploadedImageKey)) {
73
-                        if (isset($files[ $this->uploadedImageKey ])) {
73
+                        if (isset($files[$this->uploadedImageKey])) {
74 74
                             $upload->process($this->uploadedImageKey);
75 75
 
76 76
                             if ($upload->getErrors()) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
                         }
90 90
                     } elseif (count($this->uploadedImageKeys)) {
91 91
                         foreach ($this->uploadedImageKeys as $uploadedImageKey) {
92
-                            if (isset($files[ $uploadedImageKey ])) {
92
+                            if (isset($files[$uploadedImageKey])) {
93 93
                                 $upload->process($uploadedImageKey);
94 94
 
95 95
                                 if ($upload->getErrors()) {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
                     // Uploaded File Process
113 113
                     if (isset($this->uploadedFileFilepath)) {
114
-                        if (isset($files[ $this->uploadedFileKey ])) {
114
+                        if (isset($files[$this->uploadedFileKey])) {
115 115
                             $upload->process($this->uploadedFileKey);
116 116
 
117 117
                             if ($upload->getErrors()) {
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                         }
131 131
                     } elseif (count($this->uploadedFileKeys)) {
132 132
                         foreach ($this->uploadedFileKeys as $uploadedFileKey) {
133
-                            if (isset($files[ $uploadedFileKey ])) {
133
+                            if (isset($files[$uploadedFileKey])) {
134 134
                                 $upload->process($uploadedFileKey);
135 135
 
136 136
                                 if ($upload->getErrors()) {
@@ -163,9 +163,9 @@  discard block
 block discarded – undo
163 163
 
164 164
                 $label = false;
165 165
                 foreach (['name', 'label', 'title', 'code'] as $labelField) {
166
-                    if (isset($sets[ $labelField ])) {
167
-                        if(services()->has('session')) {
168
-                            session()->setFlash('success', language('SUCCESS_INSERT_WITH_LABEL', [$sets[ $labelField ]]));
166
+                    if (isset($sets[$labelField])) {
167
+                        if (services()->has('session')) {
168
+                            session()->setFlash('success', language('SUCCESS_INSERT_WITH_LABEL', [$sets[$labelField]]));
169 169
                         }
170 170
 
171 171
                         $label = true;
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                 }
175 175
 
176 176
                 if ($label === false) {
177
-                    if(services()->has('session')) {
177
+                    if (services()->has('session')) {
178 178
                         session()->setFlash('success', language('SUCCESS_INSERT'));
179 179
                     }
180 180
                 }
@@ -185,9 +185,9 @@  discard block
 block discarded – undo
185 185
 
186 186
         $label = false;
187 187
         foreach (['name', 'label', 'title', 'code'] as $labelField) {
188
-            if (isset($sets[ $labelField ])) {
189
-                if(services()->has('session')) {
190
-                    session()->setFlash('danger', language('FAILED_INSERT_WITH_LABEL', [$sets[ $labelField ]]));
188
+            if (isset($sets[$labelField])) {
189
+                if (services()->has('session')) {
190
+                    session()->setFlash('danger', language('FAILED_INSERT_WITH_LABEL', [$sets[$labelField]]));
191 191
                 }
192 192
 
193 193
                 $label = true;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         }
197 197
 
198 198
         if ($label === false) {
199
-            if(services()->has('session')) {
199
+            if (services()->has('session')) {
200 200
                 session()->setFlash('danger', language('FAILED_INSERT'));
201 201
             }
202 202
         }
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
             $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';
225 225
 
226 226
             if (empty($conditions)) {
227
-                if (isset($sets[ $primaryKey ])) {
228
-                    $conditions = [$primaryKey => $sets[ $primaryKey ]];
227
+                if (isset($sets[$primaryKey])) {
228
+                    $conditions = [$primaryKey => $sets[$primaryKey]];
229 229
                 } else {
230 230
                     $conditions = $sets;
231 231
                 }
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
             if (method_exists($this, 'insertRecordSets')) {
260 260
                 foreach ($sets as $set) {
261 261
                     $this->insertRecordSets($set);
262
-                    if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) {
263
-                        $set[ 'record_ordering' ] = $this->getRecordOrdering();
262
+                    if ($this->recordOrdering === true && empty($sets['record_ordering'])) {
263
+                        $set['record_ordering'] = $this->getRecordOrdering();
264 264
                     }
265 265
                 }
266 266
             }
@@ -332,15 +332,15 @@  discard block
 block discarded – undo
332 332
             $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';
333 333
 
334 334
             if (empty($conditions)) {
335
-                if (isset($sets[ $primaryKey ])) {
336
-                    $conditions = [$primaryKey => $sets[ $primaryKey ]];
335
+                if (isset($sets[$primaryKey])) {
336
+                    $conditions = [$primaryKey => $sets[$primaryKey]];
337 337
                 }
338 338
             }
339 339
 
340 340
             if (count($this->fillableColumns)) {
341 341
                 foreach ($sets as $key => $value) {
342 342
                     if ( ! in_array($key, $this->fillableColumns)) {
343
-                        unset($sets[ $key ]);
343
+                        unset($sets[$key]);
344 344
                     }
345 345
                 }
346 346
             }
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
             }
355 355
 
356 356
             if (method_exists($this, 'getRecordOrdering')) {
357
-                if ($this->recordOrdering === true && empty($sets[ 'record_ordering' ])) {
358
-                    $sets[ 'record_ordering' ] = $this->getRecordOrdering();
357
+                if ($this->recordOrdering === true && empty($sets['record_ordering'])) {
358
+                    $sets['record_ordering'] = $this->getRecordOrdering();
359 359
                 }
360 360
             }
361 361
 
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
                     if ($files = input()->files()) {
372 372
                         // Uploaded Image Process
373 373
                         if (isset($this->uploadedImageKey)) {
374
-                            if (isset($files[ $this->uploadedImageKey ])) {
374
+                            if (isset($files[$this->uploadedImageKey])) {
375 375
                                 $upload->process($this->uploadedImageKey);
376 376
 
377 377
                                 if ($upload->getErrors()) {
@@ -386,8 +386,8 @@  discard block
 block discarded – undo
386 386
                                     }
387 387
 
388 388
                                     return false;
389
-                                } elseif ($row->offsetGet($this->uploadedImageKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) {
390
-                                    $sets[ $this->uploadedImageKey ] = $upload->getUploadedFiles()->first()[ 'name' ];
389
+                                } elseif ($row->offsetGet($this->uploadedImageKey) !== $upload->getUploadedFiles()->first()['name']) {
390
+                                    $sets[$this->uploadedImageKey] = $upload->getUploadedFiles()->first()['name'];
391 391
 
392 392
                                     if (is_file($filePath = $this->uploadedImageFilePath . $row->offsetGet($this->uploadedImageKey))) {
393 393
                                         unlink($filePath);
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                             }
397 397
                         } elseif (count($this->uploadedImageKeys)) {
398 398
                             foreach ($this->uploadedImageKeys as $uploadedImageKey) {
399
-                                if (isset($files[ $uploadedImageKey ])) {
399
+                                if (isset($files[$uploadedImageKey])) {
400 400
                                     $upload->process($uploadedImageKey);
401 401
 
402 402
                                     if ($upload->getErrors()) {
@@ -411,8 +411,8 @@  discard block
 block discarded – undo
411 411
                                         }
412 412
 
413 413
                                         return false;
414
-                                    } elseif ($row->offsetGet($uploadedImageKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) {
415
-                                        $sets[ $uploadedImageKey ] = $upload->getUploadedFiles()->first()[ 'name' ];
414
+                                    } elseif ($row->offsetGet($uploadedImageKey) !== $upload->getUploadedFiles()->first()['name']) {
415
+                                        $sets[$uploadedImageKey] = $upload->getUploadedFiles()->first()['name'];
416 416
 
417 417
                                         if (is_file($filePath = $this->uploadedImageFilePath . $row->offsetGet($uploadedImageKey))) {
418 418
                                             unlink($filePath);
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
 
425 425
                         // Uploaded File Process
426 426
                         if (isset($this->uploadedFileFilepath)) {
427
-                            if (isset($files[ $this->uploadedFileKey ])) {
427
+                            if (isset($files[$this->uploadedFileKey])) {
428 428
                                 $upload->process($this->uploadedFileKey);
429 429
 
430 430
                                 if ($upload->getErrors()) {
@@ -439,8 +439,8 @@  discard block
 block discarded – undo
439 439
                                     }
440 440
 
441 441
                                     return false;
442
-                                } elseif ($row->offsetGet($this->uploadedFileKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) {
443
-                                    $sets[ $this->uploadedFileKey ] = $upload->getUploadedFiles()->first()[ 'name' ];
442
+                                } elseif ($row->offsetGet($this->uploadedFileKey) !== $upload->getUploadedFiles()->first()['name']) {
443
+                                    $sets[$this->uploadedFileKey] = $upload->getUploadedFiles()->first()['name'];
444 444
 
445 445
                                     if (is_file($filePath = $this->uploadedFileFilepath . $row->offsetGet($this->uploadedFileKey))) {
446 446
                                         unlink($filePath);
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                             }
450 450
                         } elseif (count($this->uploadedFileKeys)) {
451 451
                             foreach ($this->uploadedFileKeys as $uploadedFileKey) {
452
-                                if (isset($files[ $uploadedFileKey ])) {
452
+                                if (isset($files[$uploadedFileKey])) {
453 453
                                     $upload->process($uploadedFileKey);
454 454
 
455 455
                                     if ($upload->getErrors()) {
@@ -464,8 +464,8 @@  discard block
 block discarded – undo
464 464
                                         }
465 465
 
466 466
                                         return false;
467
-                                    } elseif ($row->offsetGet($uploadedFileKey) !== $upload->getUploadedFiles()->first()[ 'name' ]) {
468
-                                        $sets[ $uploadedFileKey ] = $upload->getUploadedFiles()->first()[ 'name' ];
467
+                                    } elseif ($row->offsetGet($uploadedFileKey) !== $upload->getUploadedFiles()->first()['name']) {
468
+                                        $sets[$uploadedFileKey] = $upload->getUploadedFiles()->first()['name'];
469 469
 
470 470
                                         if (is_file($filePath = $this->uploadedFileFilepath . $row->offsetGet($uploadedFileKey))) {
471 471
                                             unlink($filePath);
@@ -485,10 +485,10 @@  discard block
 block discarded – undo
485 485
 
486 486
                     $label = false;
487 487
                     foreach (['name', 'label', 'title', 'code'] as $labelField) {
488
-                        if (isset($sets[ $labelField ])) {
489
-                            if(services()->has('session')) {
488
+                        if (isset($sets[$labelField])) {
489
+                            if (services()->has('session')) {
490 490
                                 session()->setFlash('success',
491
-                                    language('SUCCESS_UPDATE_WITH_LABEL', [$sets[ $labelField ]]));
491
+                                    language('SUCCESS_UPDATE_WITH_LABEL', [$sets[$labelField]]));
492 492
                             }
493 493
 
494 494
                             $label = true;
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                     }
498 498
 
499 499
                     if ($label === false) {
500
-                        if(services()->has('session')) {
500
+                        if (services()->has('session')) {
501 501
                             session()->setFlash('success', language('SUCCESS_UPDATE'));
502 502
                         }
503 503
                     }
@@ -509,9 +509,9 @@  discard block
 block discarded – undo
509 509
 
510 510
         $label = false;
511 511
         foreach (['name', 'label', 'title', 'code'] as $labelField) {
512
-            if (isset($sets[ $labelField ])) {
513
-                if(services()->has('session')) {
514
-                    session()->setFlash('danger', language('FAILED_UPDATE_WITH_LABEL', [$sets[ $labelField ]]));
512
+            if (isset($sets[$labelField])) {
513
+                if (services()->has('session')) {
514
+                    session()->setFlash('danger', language('FAILED_UPDATE_WITH_LABEL', [$sets[$labelField]]));
515 515
                 }
516 516
 
517 517
                 $label = true;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         }
521 521
 
522 522
         if ($label === false) {
523
-            if(services()->has('session')) {
523
+            if (services()->has('session')) {
524 524
                 session()->setFlash('danger', language('FAILED_UPDATE'));
525 525
             }
526 526
         }
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
 
563 563
         if (method_exists($this, 'updateRecordSets')) {
564 564
             foreach ($sets as $key => $set) {
565
-                $this->updateRecordSets($sets[ $key ]);
565
+                $this->updateRecordSets($sets[$key]);
566 566
             }
567 567
         }
568 568
 
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
      */
779 779
     private function updateRecordStatus($id, $recordStatus, $method)
780 780
     {
781
-        $sets[ 'record_status' ] = $recordStatus;
781
+        $sets['record_status'] = $recordStatus;
782 782
         $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';
783 783
 
784 784
         if (method_exists($this, 'updateRecordSets')) {
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
     private function updateRecordStatusMany(array $ids, $recordStatus, $method)
819 819
     {
820 820
         if (count($ids)) {
821
-            $sets[ 'record_status' ] = $recordStatus;
821
+            $sets['record_status'] = $recordStatus;
822 822
             $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';
823 823
 
824 824
             $this->qb->whereIn($primaryKey, $ids);
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
     private function updateRecordStatusBy($recordStatus, $method, array $conditions)
864 864
     {
865 865
         if (count($conditions)) {
866
-            $sets[ 'record_status' ] = $recordStatus;
866
+            $sets['record_status'] = $recordStatus;
867 867
 
868 868
             if (method_exists($this, 'updateRecordSets')) {
869 869
                 $this->updateRecordSets($sets);
@@ -905,7 +905,7 @@  discard block
 block discarded – undo
905 905
     private function updateRecordStatusManyBy($recordStatus, $method, array $conditions)
906 906
     {
907 907
         if (count($conditions)) {
908
-            $sets[ 'record_status' ] = $recordStatus;
908
+            $sets['record_status'] = $recordStatus;
909 909
 
910 910
             if (method_exists($this, 'updateRecordSets')) {
911 911
                 $this->updateRecordSets($sets);
Please login to merge, or discard this patch.
src/Libraries/AccessControl/User.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -275,15 +275,15 @@  discard block
 block discarded – undo
275 275
                             } elseif ($authority->first()->permission === 'GRANTED') {
276 276
                                 // Access only granted cannot do modifier access
277 277
                                 foreach ([
278
-                                             'form',
279
-                                             'add',
280
-                                             'add-as-new',
281
-                                             'edit',
282
-                                             'update',
283
-                                             'insert',
284
-                                             'create',
285
-                                             'delete',
286
-                                         ] as $segment
278
+                                                'form',
279
+                                                'add',
280
+                                                'add-as-new',
281
+                                                'edit',
282
+                                                'update',
283
+                                                'insert',
284
+                                                'create',
285
+                                                'delete',
286
+                                            ] as $segment
287 287
                                 ) {
288 288
                                     if (in_array($segment, $segments)) {
289 289
                                         return false;
@@ -303,15 +303,15 @@  discard block
 block discarded – undo
303 303
                             } elseif ($authority->first()->permission === 'GRANTED') {
304 304
                                 // Access only granted cannot do modifier access
305 305
                                 foreach ([
306
-                                             'form',
307
-                                             'add',
308
-                                             'add-as-new',
309
-                                             'edit',
310
-                                             'update',
311
-                                             'insert',
312
-                                             'create',
313
-                                             'delete',
314
-                                         ] as $segment
306
+                                                'form',
307
+                                                'add',
308
+                                                'add-as-new',
309
+                                                'edit',
310
+                                                'update',
311
+                                                'insert',
312
+                                                'create',
313
+                                                'delete',
314
+                                            ] as $segment
315 315
                                 ) {
316 316
                                     if (in_array($segment, $segments)) {
317 317
                                         return false;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
             if (isset($account)) {
100 100
                 foreach ($account as $key => $value) {
101 101
                     if (strpos($key, 'record') !== false) {
102
-                        unset($account[ $key ]);
102
+                        unset($account[$key]);
103 103
                     } elseif (in_array($key,
104 104
                         ['password', 'pin', 'token', 'sso', 'id_sys_user', 'id_sys_module', 'id_sys_module_role'])) {
105
-                        unset($account[ $key ]);
105
+                        unset($account[$key]);
106 106
                     }
107 107
                 }
108 108
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             $column = 'id';
132 132
         } elseif (filter_var($username, FILTER_VALIDATE_EMAIL)) {
133 133
             $column = 'email';
134
-        } elseif (preg_match($this->config[ 'msisdnRegex' ], $username)) {
134
+        } elseif (preg_match($this->config['msisdnRegex'], $username)) {
135 135
             $column = 'msisdn';
136 136
         }
137 137
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     public function loggedIn()
156 156
     {
157 157
         if (parent::loggedIn()) {
158
-            if(is_object($_SESSION['account'])) {
158
+            if (is_object($_SESSION['account'])) {
159 159
                 $account = new Account($_SESSION['account']->getArrayCopy());
160 160
                 $username = $account->user->username;
161 161
             } else {
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
             $column = 'id';
212 212
         } elseif (filter_var($username, FILTER_VALIDATE_EMAIL)) {
213 213
             $column = 'email';
214
-        } elseif (preg_match($this->config[ 'msisdnRegex' ], $username)) {
214
+        } elseif (preg_match($this->config['msisdnRegex'], $username)) {
215 215
             $column = 'msisdn';
216 216
         } elseif (strpos($username, 'token-') !== false) {
217 217
             $username = str_replace('token-', '', $username);
@@ -226,15 +226,15 @@  discard block
 block discarded – undo
226 226
 
227 227
             foreach ($account as $key => $value) {
228 228
                 if (strpos($key, 'record') !== false) {
229
-                    unset($account[ $key ]);
229
+                    unset($account[$key]);
230 230
                 } elseif (in_array($key, ['password', 'pin', 'token', 'sso'])) {
231
-                    unset($account[ $key ]);
231
+                    unset($account[$key]);
232 232
                 }
233 233
             }
234 234
 
235 235
             if ($column === 'token') {
236 236
                 models('users')->update([
237
-                    'id'    => $account[ 'id' ],
237
+                    'id'    => $account['id'],
238 238
                     'token' => null,
239 239
                 ]);
240 240
             }
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
     public function getIframeCode()
387 387
     {
388 388
         if ($this->signedOn() && $this->loggedIn() === false) {
389
-            return '<iframe id="sign-on-iframe" width="1" height="1" src="' . rtrim($this->config[ 'sso' ][ 'server' ],
389
+            return '<iframe id="sign-on-iframe" width="1" height="1" src="' . rtrim($this->config['sso']['server'],
390 390
                     '/') . '" style="display: none; visibility: hidden;"></iframe>';
391 391
         }
392 392
 
Please login to merge, or discard this patch.
src/Cli/Commanders/Make/App.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             exit(EXIT_ERROR);
101 101
         }
102 102
 
103
-        $jsonProperties[ 'name' ] = readable(
103
+        $jsonProperties['name'] = readable(
104 104
             pathinfo($modulePath, PATHINFO_FILENAME),
105 105
             true
106 106
         );
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
                 ) . '\\';
114 114
         } else {
115 115
             $namespace = $this->namespace;
116
-            $jsonProperties[ 'namespace' ] = rtrim($namespace, '\\') . '\\';
116
+            $jsonProperties['namespace'] = rtrim($namespace, '\\') . '\\';
117 117
         }
118 118
 
119
-        $jsonProperties[ 'created' ] = date('d M Y');
119
+        $jsonProperties['created'] = date('d M Y');
120 120
 
121 121
         loader()->addNamespace($namespace, $modulePath);
122 122
 
Please login to merge, or discard this patch.
src/Http/Router.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             }
78 78
         } else {
79 79
             $uriPath = urldecode(
80
-                parse_url($_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH)
80
+                parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
81 81
             );
82 82
 
83 83
             $uriPathParts = explode('public/', $uriPath);
@@ -120,20 +120,20 @@  discard block
 block discarded – undo
120 120
         // Module routing
121 121
         if ($numOfUriSegments = count($uriSegments)) {
122 122
             if (empty($app)) {
123
-                if (false !== ($module = modules()->getModule( reset($uriSegments) ))) {
123
+                if (false !== ($module = modules()->getModule(reset($uriSegments)))) {
124 124
                     //array_shift($uriSegments);
125 125
                     $this->uri = $this->uri->withSegments(new KernelMessageUriSegments($uriSegments));
126 126
                     $uriString = $this->uri->getSegments()->getString();
127 127
 
128 128
                     $this->registerModule($module);
129 129
                 }
130
-            } elseif (false !== ($module = modules()->getModule( [$app->getParameter(), 'modules', reset($uriSegments) ] ))) {
130
+            } elseif (false !== ($module = modules()->getModule([$app->getParameter(), 'modules', reset($uriSegments)]))) {
131 131
                 array_shift($uriSegments);
132 132
                 $this->uri = $this->uri->withSegments(new KernelMessageUriSegments($uriSegments));
133 133
                 $uriString = $this->uri->getSegments()->getString();
134 134
 
135 135
                 $this->registerModule($module);
136
-            } elseif (false !== ($module = modules()->getModule( [$app->getParameter(), 'plugins', reset($uriSegments) ] ))) {
136
+            } elseif (false !== ($module = modules()->getModule([$app->getParameter(), 'plugins', reset($uriSegments)]))) {
137 137
                 array_shift($uriSegments);
138 138
                 $this->uri = $this->uri->withSegments(new KernelMessageUriSegments($uriSegments));
139 139
                 $uriString = $this->uri->getSegments()->getString();
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
                 $this->registerModule($module);
142 142
             }
143 143
 
144
-            if($numOfUriSegments = count($uriSegments)) {
144
+            if ($numOfUriSegments = count($uriSegments)) {
145 145
                 for ($i = 0; $i <= $numOfUriSegments; $i++) {
146 146
                     $uriRoutedSegments = array_diff($uriSegments,
147 147
                         array_slice($uriSegments, ($numOfUriSegments - $i)));
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
                     if (class_exists($controllerClassName = $controllerNamespace . implode('\\',
233 233
                             array_map('studlycase', $uriRoutedSegments)))) {
234 234
 
235
-                        if($controllerClassName::$inherited) {
235
+                        if ($controllerClassName::$inherited) {
236 236
                             $uriSegments = array_diff($uriSegments, $uriRoutedSegments);
237 237
                             $this->setController(new KernelControllerDataStructure($controllerClassName),
238 238
                                 $uriSegments);
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                      * Try to find requested page
250 250
                      */
251 251
                     if (false !== ($pagesDir = $module->getResourcesDir('pages', true))) {
252
-                        if($controllerClassName = $this->getPagesControllerClassName()) {
252
+                        if ($controllerClassName = $this->getPagesControllerClassName()) {
253 253
 
254 254
                             /**
255 255
                              * Try to find from database
@@ -284,12 +284,12 @@  discard block
 block discarded – undo
284 284
                                 presenter()->page->setFile($pageFilePath);
285 285
                             } else {
286 286
                                 $pageFilePath = str_replace('.phtml', DIRECTORY_SEPARATOR . 'index.phtml', $pageFilePath);
287
-                                if(is_file($pageFilePath)) {
287
+                                if (is_file($pageFilePath)) {
288 288
                                     presenter()->page->setFile($pageFilePath);
289 289
                                 }
290 290
                             }
291 291
 
292
-                            if(presenter()->page->file instanceof SplFileInfo) {
292
+                            if (presenter()->page->file instanceof SplFileInfo) {
293 293
                                 $this->setController(
294 294
                                     (new KernelControllerDataStructure($controllerClassName))
295 295
                                         ->setRequestMethod('index')
@@ -332,19 +332,19 @@  discard block
 block discarded – undo
332 332
     {
333 333
         $modules = modules()->getArrayCopy();
334 334
 
335
-        foreach($modules as $module) {
335
+        foreach ($modules as $module) {
336 336
             $controllerClassName = $module->getNamespace() . 'Controllers\Pages';
337 337
             if ($module->getNamespace() === 'O2System\Framework\\') {
338 338
                 $controllerClassName = 'O2System\Framework\Http\Controllers\Pages';
339 339
             }
340 340
 
341
-            if(class_exists($controllerClassName)) {
341
+            if (class_exists($controllerClassName)) {
342 342
                 return $controllerClassName;
343 343
                 break;
344 344
             }
345 345
         }
346 346
 
347
-        if(class_exists('O2System\Framework\Http\Controllers\Pages')) {
347
+        if (class_exists('O2System\Framework\Http\Controllers\Pages')) {
348 348
             return 'O2System\Framework\Http\Controllers\Pages';
349 349
         }
350 350
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                 if (class_exists($controllerClassName)) {
396 396
                     $this->addresses->any(
397 397
                         '/',
398
-                        function () use ($controllerClassName) {
398
+                        function() use ($controllerClassName) {
399 399
                             return new $controllerClassName();
400 400
                         }
401 401
                     );
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
             if (class_exists($controllerClassName)) {
411 411
                 $this->addresses->any(
412 412
                     '/',
413
-                    function () use ($controllerClassName) {
413
+                    function() use ($controllerClassName) {
414 414
                         return new $controllerClassName();
415 415
                     }
416 416
                 );
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
                 );
463 463
             } elseif (preg_match("/([a-zA-Z0-9\\\]+)(@)([a-zA-Z0-9\\\]+)/", $closure, $matches)) {
464 464
                 $this->setController(
465
-                    (new KernelControllerDataStructure($matches[ 1 ]))
466
-                        ->setRequestMethod($matches[ 3 ]),
465
+                    (new KernelControllerDataStructure($matches[1]))
466
+                        ->setRequestMethod($matches[3]),
467 467
                     $uriSegments
468 468
                 );
469 469
             } elseif (presenter()->theme->use === true) {
Please login to merge, or discard this patch.
src/Models/Sql/DataObjects/Result/Row.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
     {
88 88
         if ($this->offsetExists($offset)) {
89 89
             return parent::offsetGet($offset);
90
-        } elseif(strpos($offset, 'record') !== false) {
90
+        } elseif (strpos($offset, 'record') !== false) {
91 91
             switch ($offset) {
92 92
                 case 'record':
93 93
                     return $this->record;
Please login to merge, or discard this patch.
src/Models/Sql/Model.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
                 if ($filepath === $filePath) {
277 277
                     continue;
278 278
                 }
279
-                $this->validSubModels[ camelcase(pathinfo($filepath, PATHINFO_FILENAME)) ] = $filepath;
279
+                $this->validSubModels[camelcase(pathinfo($filepath, PATHINFO_FILENAME))] = $filepath;
280 280
             }
281 281
         }
282 282
     }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             }
345 345
         }
346 346
 
347
-        if (empty($get[ $property ])) {
347
+        if (empty($get[$property])) {
348 348
             if (services()->has($property)) {
349 349
                 return services()->get($property);
350 350
             } elseif ($this->hasSubModel($property)) {
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
     final protected function hasSubModel($model)
372 372
     {
373 373
         if (array_key_exists($model, $this->validSubModels)) {
374
-            return (bool)is_file($this->validSubModels[ $model ]);
374
+            return (bool)is_file($this->validSubModels[$model]);
375 375
         }
376 376
 
377 377
         return false;
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
      */
433 433
     final public function rebuildRowCallback(\Closure $callback)
434 434
     {
435
-        if(empty($this->rebuildRowCallback)) {
435
+        if (empty($this->rebuildRowCallback)) {
436 436
             $this->rebuildRowCallback = $callback;
437 437
         }
438 438
     }
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public function rebuildRow($row)
474 474
     {
475
-        if(is_callable($this->rebuildRowCallback)) {
475
+        if (is_callable($this->rebuildRowCallback)) {
476 476
             call_user_func($this->rebuildRowCallback, $row);
477 477
         }
478 478
     }
Please login to merge, or discard this patch.
src/Http/Controllers/Restful.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
                         $conditions = [];
339 339
 
340 340
                         foreach ($this->paramsWithRules as $param) {
341
-                            if ($get->offsetExists($param[ 'field' ])) {
342
-                                $conditions[ $param[ 'field' ] ] = $get->offsetGet($param[ 'field' ]);
341
+                            if ($get->offsetExists($param['field'])) {
342
+                                $conditions[$param['field']] = $get->offsetGet($param['field']);
343 343
                             }
344 344
                         }
345 345
 
@@ -426,22 +426,22 @@  discard block
 block discarded – undo
426 426
                     }
427 427
 
428 428
                     if ($columns = input()->request('columns')) {
429
-                        if (isset($columns[ $number ])) {
430
-                            if (isset($columns[ $number ][ 'searchable' ])) {
431
-                                if ($columns[ $number ][ 'searchable' ] === 'true') {
429
+                        if (isset($columns[$number])) {
430
+                            if (isset($columns[$number]['searchable'])) {
431
+                                if ($columns[$number]['searchable'] === 'true') {
432 432
                                     if ($search = input()->request('search')) {
433
-                                        if (isset($search[ 'value' ])) {
434
-                                            $this->model->qb->orLike($field, $search[ 'value' ]);
433
+                                        if (isset($search['value'])) {
434
+                                            $this->model->qb->orLike($field, $search['value']);
435 435
                                         }
436 436
                                     }
437 437
                                 }
438 438
                             }
439 439
 
440
-                            if (isset($columns[ $number ][ 'orderable' ])) {
441
-                                if ($columns[ $number ][ 'orderable' ] === 'true') {
440
+                            if (isset($columns[$number]['orderable'])) {
441
+                                if ($columns[$number]['orderable'] === 'true') {
442 442
                                     if ($order = input()->request('order')) {
443
-                                        if (isset($order[ $number ][ 'dir' ])) {
444
-                                            $this->model->orderBy($field, strtoupper($order[ $number ][ 'dir' ]));
443
+                                        if (isset($order[$number]['dir'])) {
444
+                                            $this->model->orderBy($field, strtoupper($order[$number]['dir']));
445 445
                                         }
446 446
                                     }
447 447
                                 }
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
                     $i++;
453 453
                 }
454 454
 
455
-                $this->model->rebuildRowCallback(function ($row) {
455
+                $this->model->rebuildRowCallback(function($row) {
456 456
                     $row->DT_RowId = 'datatable-row-' . $row->id;
457 457
 
458 458
                     foreach ($this->dataTableColumns as $number => $column) {
459 459
                         if (is_array($column)) {
460
-                            if (isset($column[ 'formatter' ])) {
461
-                                call_user_func($column[ 'formatter' ], $row);
460
+                            if (isset($column['formatter'])) {
461
+                                call_user_func($column['formatter'], $row);
462 462
                             }
463 463
                         }
464 464
                     }
@@ -468,22 +468,22 @@  discard block
 block discarded – undo
468 468
                 // Search value
469 469
                 foreach ($this->model->visibleColumns as $number => $field) {
470 470
                     if ($columns = input()->request('columns')) {
471
-                        if (isset($columns[ $number ])) {
472
-                            if (isset($columns[ $number ][ 'searchable' ])) {
473
-                                if ($columns[ $number ][ 'searchable' ] === 'true') {
471
+                        if (isset($columns[$number])) {
472
+                            if (isset($columns[$number]['searchable'])) {
473
+                                if ($columns[$number]['searchable'] === 'true') {
474 474
                                     if ($search = input()->request('search')) {
475
-                                        if (isset($search[ 'value' ])) {
476
-                                            $this->model->qb->orLike($field, $search[ 'value' ]);
475
+                                        if (isset($search['value'])) {
476
+                                            $this->model->qb->orLike($field, $search['value']);
477 477
                                         }
478 478
                                     }
479 479
                                 }
480 480
                             }
481 481
 
482
-                            if (isset($columns[ $number ][ 'orderable' ])) {
483
-                                if ($columns[ $number ][ 'orderable' ] === 'true') {
482
+                            if (isset($columns[$number]['orderable'])) {
483
+                                if ($columns[$number]['orderable'] === 'true') {
484 484
                                     if ($order = input()->request('order')) {
485
-                                        if (isset($order[ $number ][ 'dir' ])) {
486
-                                            $this->model->orderBy($field, strtoupper($order[ $number ][ 'dir' ]));
485
+                                        if (isset($order[$number]['dir'])) {
486
+                                            $this->model->orderBy($field, strtoupper($order[$number]['dir']));
487 487
                                         }
488 488
                                     }
489 489
                                 }
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
                     }
493 493
                 }
494 494
 
495
-                $this->model->rebuildRowCallback(function ($row) {
495
+                $this->model->rebuildRowCallback(function($row) {
496 496
                     $row->DT_RowId = 'datatable-row-' . $row->id;
497 497
                 });
498 498
             }
@@ -527,8 +527,8 @@  discard block
 block discarded – undo
527 527
                         $conditions = [];
528 528
 
529 529
                         foreach ($this->paramsWithRules as $param) {
530
-                            if ($get->offsetExists($param[ 'field' ])) {
531
-                                $conditions[ $param[ 'field' ] ] = $get->offsetGet($param[ 'field' ]);
530
+                            if ($get->offsetExists($param['field'])) {
531
+                                $conditions[$param['field']] = $get->offsetGet($param['field']);
532 532
                             }
533 533
                         }
534 534
 
@@ -607,14 +607,14 @@  discard block
 block discarded – undo
607 607
 
608 608
             if (count($this->fillableColumnsWithRules)) {
609 609
                 foreach ($this->fillableColumnsWithRules as $column) {
610
-                    if ($post->offsetExists($column[ 'field' ])) {
611
-                        $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]);
610
+                    if ($post->offsetExists($column['field'])) {
611
+                        $data[$column['field']] = $post->offsetGet($column['field']);
612 612
                     }
613 613
                 }
614 614
             } elseif (count($this->fillableColumns)) {
615 615
                 foreach ($this->fillableColumns as $column) {
616
-                    if ($post->offsetExists($column[ 'field' ])) {
617
-                        $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]);
616
+                    if ($post->offsetExists($column['field'])) {
617
+                        $data[$column['field']] = $post->offsetGet($column['field']);
618 618
                     }
619 619
                 }
620 620
             } else {
@@ -622,11 +622,11 @@  discard block
 block discarded – undo
622 622
             }
623 623
 
624 624
             if (count($data)) {
625
-                $data[ 'record_create_timestamp' ] = $data[ 'record_update_timestamp' ] = timestamp();
626
-                $data[ 'record_create_user' ] = $data[ 'record_update_user' ] = globals()->account->id;
625
+                $data['record_create_timestamp'] = $data['record_update_timestamp'] = timestamp();
626
+                $data['record_create_user'] = $data['record_update_user'] = globals()->account->id;
627 627
 
628 628
                 if ($this->model->insert($data)) {
629
-                    $data[ 'id' ] = $this->model->db->getLastInsertId();
629
+                    $data['id'] = $this->model->db->getLastInsertId();
630 630
                     $this->sendPayload([
631 631
                         'code' => 201,
632 632
                         'Successful insert request',
@@ -685,14 +685,14 @@  discard block
 block discarded – undo
685 685
 
686 686
             if (count($this->fillableColumnsWithRules)) {
687 687
                 foreach ($this->fillableColumnsWithRules as $column) {
688
-                    if ($post->offsetExists($column[ 'field' ])) {
689
-                        $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]);
688
+                    if ($post->offsetExists($column['field'])) {
689
+                        $data[$column['field']] = $post->offsetGet($column['field']);
690 690
                     }
691 691
                 }
692 692
             } elseif (count($this->fillableColumns)) {
693 693
                 foreach ($this->fillableColumns as $column) {
694
-                    if ($post->offsetExists($column[ 'field' ])) {
695
-                        $data[ $column[ 'field' ] ] = $post->offsetGet($column[ 'field' ]);
694
+                    if ($post->offsetExists($column['field'])) {
695
+                        $data[$column['field']] = $post->offsetGet($column['field']);
696 696
                     }
697 697
                 }
698 698
             } else {
@@ -700,8 +700,8 @@  discard block
 block discarded – undo
700 700
             }
701 701
 
702 702
             if (count($data)) {
703
-                $data[ 'record_update_timestamp' ] = timestamp();
704
-                $data[ 'record_update_user' ] = globals()->account->id;
703
+                $data['record_update_timestamp'] = timestamp();
704
+                $data['record_update_user'] = globals()->account->id;
705 705
 
706 706
 
707 707
                 if ($this->model->update($data, $conditions)) {
@@ -861,9 +861,9 @@  discard block
 block discarded – undo
861 861
             if (is_numeric(key($code))) {
862 862
                 $message = reset($code);
863 863
                 $code = key($code);
864
-            } elseif (isset($code[ 'code' ])) {
865
-                $code = $code[ 'code' ];
866
-                $message = $code[ 'message' ];
864
+            } elseif (isset($code['code'])) {
865
+                $code = $code['code'];
866
+                $message = $code['message'];
867 867
             }
868 868
         }
869 869
 
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
                 $longPoolingCacheMetadata = $longPoolingCacheData->getMetadata();
932 932
 
933 933
                 // if no timestamp delivered via ajax or data.txt has been changed SINCE last ajax timestamp
934
-                if ($lastCallTimestamp == null || $longPoolingCacheMetadata[ 'ctime' ] > $lastCallTimestamp) {
934
+                if ($lastCallTimestamp == null || $longPoolingCacheMetadata['ctime'] > $lastCallTimestamp) {
935 935
                     output()->send([
936 936
                         'timestamp' => $longPoolingCacheMetadata,
937 937
                         'data'      => $data,
Please login to merge, or discard this patch.