Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — main (#4988)
by Pedro
22:27 queued 07:33
created
src/app/Library/CrudPanel/Uploads/Uploaders/SingleBase64Image.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 {
12 12
     public function save(Model $entry, $value = null)
13 13
     {
14
-        return $this->isRepeatable && ! $this->isRelationship ? $this->saveRepeatableSingleBase64($entry, $value) : $this->saveSingleBase64($entry, $value);
14
+        return $this->isRepeatable && !$this->isRelationship ? $this->saveRepeatableSingleBase64($entry, $value) : $this->saveSingleBase64($entry, $value);
15 15
     }
16 16
 
17 17
     private function saveSingleBase64($entry, $value)
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         $value = $value ?? CRUD::getRequest()->get($this->name);
20 20
         $previousImage = $entry->getOriginal($this->name);
21 21
 
22
-        if (! $value && $previousImage) {
22
+        if (!$value && $previousImage) {
23 23
             Storage::disk($this->disk)->delete($previousImage);
24 24
 
25 25
             return null;
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Uploads/Uploaders/RepeatableUploader.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
         $this->crudObjectType = $crudObject['crudObjectType'];
25 25
     }
26 26
 
27
-    public static function for(array $crudObject)
27
+    public static function for (array $crudObject)
28 28
     {
29 29
         if (isset($crudObject['relation_type']) && $crudObject['entity'] !== false) {
30 30
             return new RepeatableRelationship($crudObject);
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public function uploads(...$uploads): self
37 37
     {
38 38
         foreach ($uploads as $upload) {
39
-            if (! is_a($upload, UploaderInterface::class)) {
39
+            if (!is_a($upload, UploaderInterface::class)) {
40 40
                 throw new \Exception('Uploads must be an instance of UploaderInterface.');
41 41
             }
42 42
             $this->repeatableUploads[] = $upload->repeats($this->name)->relationship($this->isRelationship ?? false);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $uploadedValues = $upload->save($entry, $value->pluck($upload->getName())->toArray());
67 67
 
68
-        $value = $value->map(function ($item, $key) use ($upload, $uploadedValues) {
68
+        $value = $value->map(function($item, $key) use ($upload, $uploadedValues) {
69 69
             $item[$upload->getName()] = $uploadedValues[$key] ?? null;
70 70
 
71 71
             return $item;
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
         $crudField = CRUD::field($this->name);
80 80
 
81 81
         $subfields = collect($crudField->getAttributes()['subfields']);
82
-        $subfields = $subfields->map(function ($item) {
82
+        $subfields = $subfields->map(function($item) {
83 83
             if (isset($item['withMedia']) || isset($item['withUploads'])) {
84 84
                 /** @var UploaderInterface $uploader */
85
-                $uploader = array_filter($this->repeatableUploads, function ($item) {
85
+                $uploader = array_filter($this->repeatableUploads, function($item) {
86 86
                     return $item->name !== $this->name;
87 87
                 })[0];
88 88
                 $item['upload'] = true;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     public function processFileUpload(Model $entry)
104 104
     {
105
-        if (! $this->isRelationship) {
105
+        if (!$this->isRelationship) {
106 106
             $entry->{$this->name} = json_encode($this->save($entry));
107 107
         } else {
108 108
             $entry = $this->save($entry);
@@ -130,12 +130,12 @@  discard block
 block discarded – undo
130 130
     {
131 131
         $repeatableValues = collect($entry->{$this->getName()});
132 132
         foreach ($this->repeatableUploads as $upload) {
133
-            if (! $upload->deleteWhenEntryIsDeleted) {
133
+            if (!$upload->deleteWhenEntryIsDeleted) {
134 134
                 continue;
135 135
             }
136 136
             $values = $repeatableValues->pluck($upload->getName())->toArray();
137 137
             foreach ($values as $value) {
138
-                if (! $value) {
138
+                if (!$value) {
139 139
                     continue;
140 140
                 }
141 141
                 if (is_array($value)) {
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Uploads/Uploaders/RepeatableRelationship.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
             $values = $entry->{$upload->name};
55 55
 
56 56
             if ($upload->isMultiple) {
57
-                if (! isset($entry->getCasts()[$upload->name]) && is_string($values)) {
57
+                if (!isset($entry->getCasts()[$upload->name]) && is_string($values)) {
58 58
                     $values = json_decode($values, true);
59 59
                 }
60 60
             } else {
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Uploads/Uploaders/MultipleFiles.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@  discard block
 block discarded – undo
9 9
 
10 10
 class MultipleFiles extends Uploader
11 11
 {
12
-    public static function for(array $field, $configuration)
12
+    public static function for (array $field, $configuration)
13 13
     {
14 14
         return (new self($field, $configuration))->multiple();
15 15
     }
16 16
 
17 17
     public function save(Model $entry, $value = null)
18 18
     {
19
-        return $this->isRepeatable && ! $this->isRelationship ? $this->saveRepeatableMutipleFiles($entry, $value) : $this->saveMultipleFiles($entry, $value);
19
+        return $this->isRepeatable && !$this->isRelationship ? $this->saveRepeatableMutipleFiles($entry, $value) : $this->saveMultipleFiles($entry, $value);
20 20
     }
21 21
 
22 22
     private function saveMultipleFiles($entry, $value = null)
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
         $previousFiles = $entry->getOriginal($this->name) ?? [];
29 29
         
30
-        if (! is_array($previousFiles) && is_string($previousFiles)) {
30
+        if (!is_array($previousFiles) && is_string($previousFiles)) {
31 31
             $previousFiles = json_decode($previousFiles, true);
32 32
         }
33 33
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
                 if (in_array($previousFile, $filesToDelete)) {
37 37
                     Storage::disk($this->disk)->delete($previousFile);
38 38
 
39
-                    $previousFiles = Arr::where($previousFiles, function ($value, $key) use ($previousFile) {
39
+                    $previousFiles = Arr::where($previousFiles, function($value, $key) use ($previousFile) {
40 40
                         return $value != $previousFile;
41 41
                     });
42 42
                 }
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Uploads/Uploaders/SingleFile.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function save(Model $entry, $value = null)
12 12
     {
13
-        return $this->isRepeatable && ! $this->isRelationship ? $this->saveRepeatableFile($entry, $value) : $this->saveFile($entry, $value);
13
+        return $this->isRepeatable && !$this->isRelationship ? $this->saveRepeatableFile($entry, $value) : $this->saveFile($entry, $value);
14 14
     }
15 15
 
16 16
     private function saveRepeatableFile($entry, $values)
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         }
32 32
 
33 33
         foreach ($previousFiles as $row => $file) {
34
-            if ($file && ! isset($orderedFiles[$row])) {
34
+            if ($file && !isset($orderedFiles[$row])) {
35 35
                 $orderedFiles[$row] = null;
36 36
                 Storage::disk($this->disk)->delete($file);
37 37
             }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             return $this->path.$fileName;
58 58
         }
59 59
 
60
-        if (! $value && CrudPanelFacade::getRequest()->has($this->name) && $previousFile) {
60
+        if (!$value && CrudPanelFacade::getRequest()->has($this->name) && $previousFile) {
61 61
             Storage::disk($this->disk)->delete($previousFile);
62 62
 
63 63
             return null;
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Uploads/Interfaces/UploaderInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
     public function deleteUploadedFile(Model $entry);
14 14
 
15
-    public static function for(array $field, array $configuration);
15
+    public static function for (array $field, array $configuration);
16 16
 
17 17
     public function __construct(array $crudObject, array $configuration);
18 18
 
Please login to merge, or discard this patch.
app/Library/CrudPanel/Uploads/Interfaces/RepeatableUploaderInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 {
9 9
     public function uploads(...$uploads): self;
10 10
 
11
-    public static function for(array $field);
11
+    public static function for (array $field);
12 12
 
13 13
     public function processFileUpload(Model $entry);
14 14
 
Please login to merge, or discard this patch.
src/app/Library/CrudPanel/Traits/Fields.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $this->enableTabsIfFieldUsesThem($field);
111 111
         $this->addFieldToOperationSettings($field);
112 112
 
113
-        if (! app('UploadStore')->isUploadHandled($field['name'])) {
113
+        if (!app('UploadStore')->isUploadHandled($field['name'])) {
114 114
             $crudFieldObject = (new CrudField($field['name']));
115 115
 
116 116
             foreach ($field as $attribute => $value) {
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     public function afterField($targetFieldName)
146 146
     {
147
-        $this->transformFields(function ($fields) use ($targetFieldName) {
147
+        $this->transformFields(function($fields) use ($targetFieldName) {
148 148
             return $this->moveField($fields, $targetFieldName, false);
149 149
         });
150 150
     }
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function beforeField($targetFieldName)
158 158
     {
159
-        $this->transformFields(function ($fields) use ($targetFieldName) {
159
+        $this->transformFields(function($fields) use ($targetFieldName) {
160 160
             return $this->moveField($fields, $targetFieldName, true);
161 161
         });
162 162
     }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public function makeFirstField()
170 170
     {
171
-        if (! $this->fields()) {
171
+        if (!$this->fields()) {
172 172
             return false;
173 173
         }
174 174
 
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
      */
184 184
     public function removeField($name)
185 185
     {
186
-        $this->transformFields(function ($fields) use ($name) {
186
+        $this->transformFields(function($fields) use ($name) {
187 187
             Arr::forget($fields, $name);
188 188
 
189 189
             return $fields;
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
      */
198 198
     public function removeFields($array_of_names)
199 199
     {
200
-        if (! empty($array_of_names)) {
200
+        if (!empty($array_of_names)) {
201 201
             foreach ($array_of_names as $name) {
202 202
                 $this->removeField($name);
203 203
             }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
     public function removeAllFields()
211 211
     {
212 212
         $current_fields = $this->getCleanStateFields();
213
-        if (! empty($current_fields)) {
213
+        if (!empty($current_fields)) {
214 214
             foreach ($current_fields as $field) {
215 215
                 $this->removeField($field['name']);
216 216
             }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                 $jsonCastables = ['array', 'object', 'json'];
306 306
                 $fieldCasting = $casted_attributes[$field['name']];
307 307
 
308
-                if (in_array($fieldCasting, $jsonCastables) && isset($input[$field['name']]) && ! empty($input[$field['name']]) && ! is_array($input[$field['name']])) {
308
+                if (in_array($fieldCasting, $jsonCastables) && isset($input[$field['name']]) && !empty($input[$field['name']]) && !is_array($input[$field['name']])) {
309 309
                     try {
310 310
                         $input[$field['name']] = json_decode($input[$field['name']]);
311 311
                     } catch (\Exception $e) {
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
      */
335 335
     public function orderFields($order)
336 336
     {
337
-        $this->transformFields(function ($fields) use ($order) {
337
+        $this->transformFields(function($fields) use ($order) {
338 338
             return $this->applyOrderToFields($fields, $order);
339 339
         });
340 340
     }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     public function hasUploadFields()
361 361
     {
362 362
         $fields = $this->getCleanStateFields();
363
-        $upload_fields = Arr::where($fields, function ($value, $key) {
363
+        $upload_fields = Arr::where($fields, function($value, $key) {
364 364
             if (isset($value['subfields'])) {
365 365
                 foreach ($value['subfields'] as $subfield) {
366 366
                     if (isset($subfield['upload']) && $subfield['upload'] === true) {
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
         $alreadyLoaded = $this->getLoadedFieldTypes();
432 432
         $type = $this->getFieldTypeWithNamespace($field);
433 433
 
434
-        if (! in_array($type, $this->getLoadedFieldTypes(), true)) {
434
+        if (!in_array($type, $this->getLoadedFieldTypes(), true)) {
435 435
             $alreadyLoaded[] = $type;
436 436
             $this->setLoadedFieldTypes($alreadyLoaded);
437 437
 
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public function fieldTypeNotLoaded($field)
474 474
     {
475
-        return ! in_array($this->getFieldTypeWithNamespace($field), $this->getLoadedFieldTypes());
475
+        return !in_array($this->getFieldTypeWithNamespace($field), $this->getLoadedFieldTypes());
476 476
     }
477 477
 
478 478
     /**
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
      */
522 522
     public function hasFieldWhere($attribute, $value)
523 523
     {
524
-        $match = Arr::first($this->getCleanStateFields(), function ($field, $fieldKey) use ($attribute, $value) {
524
+        $match = Arr::first($this->getCleanStateFields(), function($field, $fieldKey) use ($attribute, $value) {
525 525
             return isset($field[$attribute]) && $field[$attribute] == $value;
526 526
         });
527 527
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
      */
538 538
     public function firstFieldWhere($attribute, $value)
539 539
     {
540
-        return Arr::first($this->getCleanStateFields(), function ($field, $fieldKey) use ($attribute, $value) {
540
+        return Arr::first($this->getCleanStateFields(), function($field, $fieldKey) use ($attribute, $value) {
541 541
             return isset($field[$attribute]) && $field[$attribute] == $value;
542 542
         });
543 543
     }
Please login to merge, or discard this patch.
src/BackpackServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -66,24 +66,24 @@  discard block
 block discarded – undo
66 66
         include_once __DIR__.'/macros.php';
67 67
 
68 68
         // Bind the CrudPanel object to Laravel's service container
69
-        $this->app->scoped('crud', function ($app) {
69
+        $this->app->scoped('crud', function($app) {
70 70
             return new CrudPanel();
71 71
         });
72 72
 
73
-        $this->app->scoped('DatabaseSchema', function ($app) {
73
+        $this->app->scoped('DatabaseSchema', function($app) {
74 74
             return new DatabaseSchema();
75 75
         });
76 76
 
77
-        $this->app->singleton('BackpackViewNamespaces', function ($app) {
77
+        $this->app->singleton('BackpackViewNamespaces', function($app) {
78 78
             return new ViewNamespaces();
79 79
         });
80 80
 
81 81
         // Bind the widgets collection object to Laravel's service container
82
-        $this->app->singleton('widgets', function ($app) {
82
+        $this->app->singleton('widgets', function($app) {
83 83
             return new Collection();
84 84
         });
85 85
 
86
-        $this->app->scoped('UploadStore', function ($app) {
86
+        $this->app->scoped('UploadStore', function($app) {
87 87
             return new UploadStore();
88 88
         });
89 89
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $middleware_key = config('backpack.base.middleware_key');
100 100
         $middleware_class = config('backpack.base.middleware_class');
101 101
 
102
-        if (! is_array($middleware_class)) {
102
+        if (!is_array($middleware_class)) {
103 103
             $router->pushMiddlewareToGroup($middleware_key, $middleware_class);
104 104
 
105 105
             return;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $operationConfigs = scandir(__DIR__.'/config/backpack/operations/');
216 216
         $operationConfigs = array_diff($operationConfigs, ['.', '..']);
217 217
 
218
-        if (! count($operationConfigs)) {
218
+        if (!count($operationConfigs)) {
219 219
             return;
220 220
         }
221 221
 
Please login to merge, or discard this patch.