Passed
Push — master ( 2ac577...7dde7a )
by Nicolaas
02:51
created
src/Control/Fix.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
     protected function init()
68 68
     {
69 69
         parent::init();
70
-        if (! Permission::check('ADMIN')) {
70
+        if (!Permission::check('ADMIN')) {
71 71
             return Security::permissionFailure($this);
72 72
         }
73 73
 
Please login to merge, or discard this patch.
src/Reports/ImagesPerFieldReport.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                     $list = $list->{$filterMethod}([$field => 0]);
122 122
                 } else {
123 123
                     $list = $list->filterByCallBack(
124
-                        function ($item) use ($fieldUsed, $existsValue) {
124
+                        function($item) use ($fieldUsed, $existsValue) {
125 125
                             return (bool) $item->{$fieldUsed}()->exists() === $existsValue;
126 126
                         }
127 127
                     );
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public function sourceQuery($params)
145 145
     {
146
-        if (! $this->hasMethod('sourceRecords')) {
146
+        if (!$this->hasMethod('sourceRecords')) {
147 147
             throw new \RuntimeException(
148 148
                 'Please override sourceQuery()/sourceRecords() and columns() or, if necessary, override getReportField()'
149 149
             );
Please login to merge, or discard this patch.
src/Traits/FilesystemRelatedTraits.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     protected function getBaseFolder(): string
40 40
     {
41
-        if (! $this->baseFolder) {
41
+        if (!$this->baseFolder) {
42 42
             $this->baseFolder = rtrim(Director::baseFolder(), DIRECTORY_SEPARATOR);
43 43
         }
44 44
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
     protected function getPublicBaseFolder(): string
49 49
     {
50
-        if (! $this->publicBaseFolder) {
50
+        if (!$this->publicBaseFolder) {
51 51
             $this->publicBaseFolder = rtrim(Director::publicFolder(), DIRECTORY_SEPARATOR);
52 52
         }
53 53
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
     protected function getAssetsBaseFolder(): string
58 58
     {
59
-        if (! $this->assetsBaseFolder) {
59
+        if (!$this->assetsBaseFolder) {
60 60
             $this->assetsBaseFolder = rtrim(ASSETS_PATH, DIRECTORY_SEPARATOR);
61 61
         }
62 62
 
Please login to merge, or discard this patch.
src/Api/CompareImages.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
         $i1 = $this->createImage($a);
11 11
         $i2 = $this->createImage($b);
12 12
 
13
-        if (! $i1 || ! $i2) {
13
+        if (!$i1 || !$i2) {
14 14
             return false;
15 15
         }
16 16
 
Please login to merge, or discard this patch.
src/Api/FilesSimilarToMe.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
         foreach ($a as $file) {
19 19
             $nameOne = $file->Path;
20 20
             $nameOneFromAssets = $file->PathFromAssetsFolder;
21
-            if (! in_array($nameOne, $alreadyDone, true)) {
21
+            if (!in_array($nameOne, $alreadyDone, true)) {
22 22
                 $easyFind = false;
23 23
                 $sortArray = [];
24 24
                 foreach ($b as $compareImage) {
Please login to merge, or discard this patch.
src/Api/ImageFieldFinder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
                 $fieldLabels = $obj->fieldLabels(true);
24 24
                 foreach ($types as $type) {
25 25
                     $rels = Config::inst()->get($className, $type, Config::UNINHERITED);
26
-                    if (is_array($rels) && ! empty($rels)) {
26
+                    if (is_array($rels) && !empty($rels)) {
27 27
                         foreach ($rels as $relName => $relType) {
28 28
                             if (is_a($relType, File::class, true)) {
29 29
                                 $title = $obj->i18n_singular_name() . ' - ' . ($fieldLabels[$relName] ?? $relName);
Please login to merge, or discard this patch.
src/Control/View.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
     protected function init()
356 356
     {
357 357
         parent::init();
358
-        if (! Permission::check('ADMIN')) {
358
+        if (!Permission::check('ADMIN')) {
359 359
             return Security::permissionFailure($this);
360 360
         }
361 361
 
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 
401 401
         $extensions = $this->request->getVar('extensions');
402 402
         if ($extensions) {
403
-            if (! is_array($extensions)) {
403
+            if (!is_array($extensions)) {
404 404
                 $extensions = [$extensions];
405 405
             }
406 406
 
@@ -548,11 +548,11 @@  discard block
 block discarded – undo
548 548
         $step = 100;
549 549
         $array = [];
550 550
         $i = 0;
551
-        $totalRaw = (int)  $this->getAllFilesInfoProvider()->getTotalFileCountRaw();
552
-        $totalFiltered = (int)  $this->getAllFilesInfoProvider()->getTotalFileCountFiltered();
551
+        $totalRaw = (int) $this->getAllFilesInfoProvider()->getTotalFileCountRaw();
552
+        $totalFiltered = (int) $this->getAllFilesInfoProvider()->getTotalFileCountFiltered();
553 553
         if ($totalRaw > $step) {
554 554
             for ($i = $step; ($i - $step) < $totalFiltered; $i += $step) {
555
-                if ($i > $this->limit && ! isset($array[$this->limit])) {
555
+                if ($i > $this->limit && !isset($array[$this->limit])) {
556 556
                     $array[$this->limit] = $this->limit;
557 557
                 }
558 558
 
Please login to merge, or discard this patch.
src/Files/AllFilesInfo.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      */
220 220
     public function getStagingData(string $pathFromAssets, ?int $id = 0): array
221 221
     {
222
-        if (! $id) {
222
+        if (!$id) {
223 223
             $id = $this->databaseLookupListStaging[$pathFromAssets] ?? 0;
224 224
         }
225 225
 
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function getLiveData(string $pathFromAssets, ?int $id = 0): array
235 235
     {
236
-        if (! $id) {
236
+        if (!$id) {
237 237
             $id = $this->databaseLookupListLive[$pathFromAssets] ?? 0;
238 238
         }
239 239
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
     protected function registerFile($path, ?bool $inFileSystem = true)
528 528
     {
529 529
         if ($path) {
530
-            if (! isset($this->listOfFiles[$path])) {
530
+            if (!isset($this->listOfFiles[$path])) {
531 531
                 $this->listOfFiles[$path] = $inFileSystem;
532 532
                 if ($this->verbose) {
533 533
                     if ($inFileSystem) {
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 
572 572
         $fileName = basename($absolutePath);
573 573
         $isErrorPage = ('error' === substr((string) $fileName, 0, 5) && '.html' === substr((string) $fileName, -5));
574
-        return ! $isErrorPage;
574
+        return !$isErrorPage;
575 575
     }
576 576
 
577 577
     protected function getArrayOfFilesOnDisk(): array
Please login to merge, or discard this patch.
src/Files/OneFileInfo.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     public function toArray(): array
109 109
     {
110 110
         $cachekey = $this->getCacheKey();
111
-        if (! $this->hasCacheKey($cachekey) || $this->noCache) {
111
+        if (!$this->hasCacheKey($cachekey) || $this->noCache) {
112 112
             $this->collateIntel();
113 113
             if ($this->debug) {
114 114
                 if ($this->intel['ErrorHasAnyError']) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 } else {
239 239
                     $this->intel['ImageRatio'] = 0;
240 240
                 }
241
-                $this->intel['ImagePixels'] =  $this->intel['ImageHeight'] * $this->intel['ImageWidth'];
241
+                $this->intel['ImagePixels'] = $this->intel['ImageHeight'] * $this->intel['ImageWidth'];
242 242
                 $this->intel['IsResizedImage'] = (bool) strpos($this->intel['PathFileName'], '__');
243 243
             }
244 244
         }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
     {
249 249
         $folder = [];
250 250
         $hasFolder = false;
251
-        if (! empty($dbFileData['ParentID'])) {
251
+        if (!empty($dbFileData['ParentID'])) {
252 252
             $sql = 'SELECT ID FROM "File" WHERE "ID" = ' . $dbFileData['ParentID'] . ' LIMIT 1';
253 253
             $rows = DB::query($sql);
254 254
             foreach ($rows as $folder) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             $this->intel['FolderID'] = $folder['ID'];
263 263
             $this->intel['FolderCMSEditLink'] = '/admin/assets/show/' . $this->intel['FolderID'] . '/';
264 264
         } else {
265
-            $this->intel['ErrorFindingFolder'] = ! empty($dbFileData['ParentID']);
265
+            $this->intel['ErrorFindingFolder'] = !empty($dbFileData['ParentID']);
266 266
             $this->intel['FolderID'] = 0;
267 267
             $this->intel['FolderCMSEditLink'] = '/admin/assets';
268 268
         }
@@ -306,14 +306,14 @@  discard block
 block discarded – undo
306 306
             $this->intel['DBFilename'] = $dbFileData['Name'] ?: basename($this->intel['DBPath']);
307 307
             $existsOnStaging = $obj->existsOnStaging($this->intel['DBID']);
308 308
             $existsOnLive = $obj->existsOnLive($this->intel['DBID']);
309
-            $this->intel['ErrorDBNotPresentStaging'] = ! $existsOnStaging;
310
-            $this->intel['ErrorDBNotPresentLive'] = ! $existsOnLive;
311
-            $this->intel['ErrorInDraftOnly'] = $existsOnStaging && ! $existsOnLive;
312
-            $this->intel['ErrorNotInDraft'] = ! $existsOnStaging && $existsOnLive;
309
+            $this->intel['ErrorDBNotPresentStaging'] = !$existsOnStaging;
310
+            $this->intel['ErrorDBNotPresentLive'] = !$existsOnLive;
311
+            $this->intel['ErrorInDraftOnly'] = $existsOnStaging && !$existsOnLive;
312
+            $this->intel['ErrorNotInDraft'] = !$existsOnStaging && $existsOnLive;
313 313
             $this->intel['DBCMSEditLink'] = '/admin/assets/EditForm/field/File/item/' . $this->intel['DBID'] . '/edit';
314 314
             $this->intel['DBTitle'] = $dbFileData['Title'];
315 315
             $this->intel['DBFilenameSS4'] = $dbFileData['FileFilename'] ?? 'none';
316
-            $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none';;
316
+            $this->intel['DBFilenameSS3'] = $dbFileData['Filename'] ?? 'none'; ;
317 317
             $this->intel['ErrorInFilename'] = $this->intel['Path'] !== $this->intel['DBPath'];
318 318
             $ss3FileName = $dbFileData['Filename'] ?? '';
319 319
             if ('assets/' === substr((string) $ss3FileName, 0, strlen('assets/'))) {
Please login to merge, or discard this patch.