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 — next (#5733)
by
unknown
17:40 queued 03:05
created
tests/Feature/FakeUploadersTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             '_method' => 'PUT',
94 94
             'upload' => $this->getUploadedFile('avatar4.jpg'),
95 95
             'upload_multiple' => $this->getUploadedFiles(['avatar5.jpg', 'avatar6.jpg']),
96
-            'clear_upload_multiple' => ['avatar2.jpg',  'avatar3.jpg'],
96
+            'clear_upload_multiple' => ['avatar2.jpg', 'avatar3.jpg'],
97 97
             'id' => 1,
98 98
         ]);
99 99
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $this->assertDatabaseCount('uploaders', 1);
174 174
 
175 175
         $this->assertDatabaseHas('uploaders', [
176
-            'extras' => json_encode(['upload_multiple' => ['avatar2.jpg',  'avatar3.jpg'], 'upload' => 'avatar1.jpg']),
176
+            'extras' => json_encode(['upload_multiple' => ['avatar2.jpg', 'avatar3.jpg'], 'upload' => 'avatar1.jpg']),
177 177
         ]);
178 178
 
179 179
         $files = Storage::disk('uploaders')->allFiles();
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         self::initUploaderWithFiles();
191 191
 
192 192
         $response = $this->put($this->testBaseUrl.'/1', [
193
-            'upload_multiple' => $this->getUploadedFiles(['avatar4.jpg',  'avatar5.jpg']),
193
+            'upload_multiple' => $this->getUploadedFiles(['avatar4.jpg', 'avatar5.jpg']),
194 194
             'clear_upload_multiple' => ['avatar2.jpg'],
195 195
             'id' => 1,
196 196
         ]);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $this->assertDatabaseCount('uploaders', 1);
203 203
 
204 204
         $this->assertDatabaseHas('uploaders', [
205
-            'extras' => json_encode(['upload_multiple' => ['avatar3.jpg', 'avatar4.jpg',  'avatar5.jpg'], 'upload' => 'avatar1.jpg']),
205
+            'extras' => json_encode(['upload_multiple' => ['avatar3.jpg', 'avatar4.jpg', 'avatar5.jpg'], 'upload' => 'avatar1.jpg']),
206 206
         ]);
207 207
 
208 208
         $files = Storage::disk('uploaders')->allFiles();
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
         UploadedFile::fake()->image('avatar3.jpg')->storeAs('', 'avatar3.jpg', ['disk' => 'uploaders']);
223 223
 
224 224
         FakeUploader::create([
225
-            'extras' => ['upload' => 'avatar1.jpg', 'upload_multiple' => ['avatar2.jpg',  'avatar3.jpg']],
225
+            'extras' => ['upload' => 'avatar1.jpg', 'upload_multiple' => ['avatar2.jpg', 'avatar3.jpg']],
226 226
         ]);
227 227
     }
228 228
 
Please login to merge, or discard this patch.
tests/Feature/UploadersValidationTest.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $this->assertDatabaseHas('uploaders', [
64 64
             'upload' => 'avatar1.jpg',
65
-            'upload_multiple' => json_encode(['avatar2.jpg',  'avatar3.jpg']),
65
+            'upload_multiple' => json_encode(['avatar2.jpg', 'avatar3.jpg']),
66 66
         ]);
67 67
 
68 68
         $this->assertTrue(Storage::disk('uploaders')->exists('avatar1.jpg'));
@@ -97,8 +97,8 @@  discard block
 block discarded – undo
97 97
 
98 98
         $response = $this->put($this->testBaseUrl.'/1', [
99 99
             'upload' => $this->getUploadedFile('avatar4.jpg'),
100
-            'upload_multiple' => $this->getUploadedFiles(['avatar5.jpg',  'avatar6.jpg']),
101
-            'clear_upload_multiple' => ['avatar2.jpg',  'avatar3.jpg'],
100
+            'upload_multiple' => $this->getUploadedFiles(['avatar5.jpg', 'avatar6.jpg']),
101
+            'clear_upload_multiple' => ['avatar2.jpg', 'avatar3.jpg'],
102 102
             'id' => 1,
103 103
         ]);
104 104
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 
111 111
         $this->assertDatabaseHas('uploaders', [
112 112
             'upload' => 'avatar4.jpg',
113
-            'upload_multiple' => json_encode(['avatar5.jpg',  'avatar6.jpg']),
113
+            'upload_multiple' => json_encode(['avatar5.jpg', 'avatar6.jpg']),
114 114
         ]);
115 115
 
116 116
         $files = Storage::disk('uploaders')->allFiles();
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         self::initUploaderWithFiles();
143 143
 
144 144
         $response = $this->put($this->testBaseUrl.'/1', [
145
-            'upload_multiple' => ['avatar2.jpg',  'avatar3.jpg'],
145
+            'upload_multiple' => ['avatar2.jpg', 'avatar3.jpg'],
146 146
             'id' => 1,
147 147
         ]);
148 148
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
         $this->assertDatabaseHas('uploaders', [
156 156
             'upload' => 'avatar1.jpg',
157
-            'upload_multiple' => json_encode(['avatar2.jpg',  'avatar3.jpg']),
157
+            'upload_multiple' => json_encode(['avatar2.jpg', 'avatar3.jpg']),
158 158
         ]);
159 159
 
160 160
         $files = Storage::disk('uploaders')->allFiles();
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
         self::initUploaderWithFiles();
172 172
 
173 173
         $response = $this->put($this->testBaseUrl.'/1', [
174
-            'upload_multiple' => $this->getUploadedFiles(['avatar4.jpg',  'avatar5.jpg']),
174
+            'upload_multiple' => $this->getUploadedFiles(['avatar4.jpg', 'avatar5.jpg']),
175 175
             'clear_upload_multiple' => ['avatar2.jpg'],
176 176
             'id' => 1,
177 177
         ]);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 
185 185
         $this->assertDatabaseHas('uploaders', [
186 186
             'upload' => 'avatar1.jpg',
187
-            'upload_multiple' => json_encode(['avatar3.jpg', 'avatar4.jpg',  'avatar5.jpg']),
187
+            'upload_multiple' => json_encode(['avatar3.jpg', 'avatar4.jpg', 'avatar5.jpg']),
188 188
         ]);
189 189
 
190 190
         $files = Storage::disk('uploaders')->allFiles();
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
         $response = $this->put($this->testBaseUrl.'/1', [
342 342
             'upload' => null,
343 343
             'upload_multiple' => null,
344
-            'clear_upload_multiple' => ['avatar2.jpg',  'avatar3.jpg'],
344
+            'clear_upload_multiple' => ['avatar2.jpg', 'avatar3.jpg'],
345 345
             'id' => 1,
346 346
         ]);
347 347
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
         $response = $this->put($this->testBaseUrl.'/1', [
366 366
             'upload_multiple' => $this->getUploadedFiles(['avatar2.jpg']),
367
-            'clear_upload_multiple' => ['avatar2.jpg',  'avatar3.jpg'],
367
+            'clear_upload_multiple' => ['avatar2.jpg', 'avatar3.jpg'],
368 368
             'id' => 1,
369 369
         ]);
370 370
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 
387 387
         Uploader::create([
388 388
             'upload' => 'avatar1.jpg',
389
-            'upload_multiple' => json_encode(['avatar2.jpg',  'avatar3.jpg']),
389
+            'upload_multiple' => json_encode(['avatar2.jpg', 'avatar3.jpg']),
390 390
         ]);
391 391
     }
392 392
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 
399 399
         Uploader::create([
400 400
             'upload' => 'avatar1.jpg',
401
-            'upload_multiple' => json_encode(['avatar2.jpg',  'avatar3.jpg']),
401
+            'upload_multiple' => json_encode(['avatar2.jpg', 'avatar3.jpg']),
402 402
         ]);
403 403
     }
404 404
 
Please login to merge, or discard this patch.
tests/config/Uploads/HasUploadedFiles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 
14 14
     protected function getUploadedFiles(array $fileNames, string $mime = 'image/jpg')
15 15
     {
16
-        return array_map(function ($fileName) use ($mime) {
16
+        return array_map(function($fileName) use ($mime) {
17 17
             return new UploadedFile(__DIR__.'/assets/'.$fileName, $fileName, $mime, null, true);
18 18
         }, $fileNames);
19 19
     }
Please login to merge, or discard this patch.
src/app/Library/Database/DatabaseSchema.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $connection = $connection ?: config('database.default');
28 28
 
29
-        self::$schema[$connection] = LazyCollection::make(self::getCreateSchema($connection)->getTables())->mapWithKeys(function ($table, $key) use ($connection) {
29
+        self::$schema[$connection] = LazyCollection::make(self::getCreateSchema($connection)->getTables())->mapWithKeys(function($table, $key) use ($connection) {
30 30
             $tableName = is_array($table) ? $table['name'] : $table->getName();
31 31
 
32 32
             if ($existingTable = self::$schema[$connection][$tableName] ?? false) {
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     private static function generateDatabaseSchema(string $connection, string $table)
67 67
     {
68
-        if (! isset(self::$schema[$connection][$table])) {
68
+        if (!isset(self::$schema[$connection][$table])) {
69 69
             self::$schema[$connection][$table] = self::mapTable($connection, $table);
70 70
         }
71 71
     }
@@ -74,13 +74,12 @@  discard block
 block discarded – undo
74 74
     {
75 75
         try {
76 76
             $table = method_exists(self::getCreateSchema($connection), 'getTable') ?
77
-                        self::getCreateSchema($connection)->getTable($tableName) :
78
-                        self::getCreateSchema($connection)->getColumns($tableName);
77
+                        self::getCreateSchema($connection)->getTable($tableName) : self::getCreateSchema($connection)->getColumns($tableName);
79 78
         } catch (\Exception $e) {
80 79
             return new Table($tableName, []);
81 80
         }
82 81
 
83
-        if (! is_array($table)) {
82
+        if (!is_array($table)) {
84 83
             return $table;
85 84
         }
86 85
 
@@ -91,7 +90,7 @@  discard block
 block discarded – undo
91 90
         $schemaManager = self::getSchemaManager($connection);
92 91
         $indexes = $schemaManager->getIndexes($tableName);
93 92
 
94
-        $indexes = array_map(function ($index) {
93
+        $indexes = array_map(function($index) {
95 94
             return $index['columns'];
96 95
         }, $indexes);
97 96
 
@@ -109,7 +108,7 @@  discard block
 block discarded – undo
109 108
 
110 109
         $indexes = self::$schema[$connection][$table]->getIndexes();
111 110
 
112
-        $indexes = \Illuminate\Support\Arr::flatten(array_map(function ($index) {
111
+        $indexes = \Illuminate\Support\Arr::flatten(array_map(function($index) {
113 112
             return is_string($index) ? $index : $index->getColumns();
114 113
         }, $indexes));
115 114
 
Please login to merge, or discard this patch.
src/app/Library/Uploaders/SingleFile.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             return $this->getPath().$fileName;
30 30
         }
31 31
 
32
-        if (! $value && CrudPanelFacade::getRequest()->has($this->getNameForRequest()) && $previousFile) {
32
+        if (!$value && CrudPanelFacade::getRequest()->has($this->getNameForRequest()) && $previousFile) {
33 33
             Storage::disk($this->getDisk())->delete($previousFile);
34 34
 
35 35
             return null;
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
 
56 56
         foreach ($previousRepeatableValues as $row => $file) {
57 57
             if ($file) {
58
-                if (! isset($orderedFiles[$row])) {
58
+                if (!isset($orderedFiles[$row])) {
59 59
                     $orderedFiles[$row] = null;
60 60
                 }
61
-                if (! in_array($file, $orderedFiles)) {
61
+                if (!in_array($file, $orderedFiles)) {
62 62
                     Storage::disk($this->getDisk())->delete($file);
63 63
                 }
64 64
             }
Please login to merge, or discard this patch.
src/app/Console/Commands/Themes/InstallsTheme.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         }
72 72
 
73 73
         // Display general error in case it failed
74
-        if (! $this->isInstalled()) {
74
+        if (!$this->isInstalled()) {
75 75
             $this->errorProgressBlock();
76 76
             $this->note('For further information please check the log file.');
77 77
             $this->note('You can also follow the manual installation process documented on GitHub.');
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         $this->progressBlock('Publish theme config file');
85 85
 
86 86
         // manually include the provider in the run-time
87
-        if (! class_exists(self::$addon['provider'])) {
87
+        if (!class_exists(self::$addon['provider'])) {
88 88
             include self::$addon['provider_path'] ?? self::$addon['path'].'/src/AddonServiceProvider.php';
89 89
             app()->register(self::$addon['provider']);
90 90
         }
Please login to merge, or discard this patch.
config/database/migrations/2024_02_15_125654_create_uploaders_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function up(): void
13 13
     {
14
-        Schema::create('uploaders', function (Blueprint $table) {
14
+        Schema::create('uploaders', function(Blueprint $table) {
15 15
             $table->bigIncrements('id')->unsigned();
16 16
             $table->string('upload')->nullable();
17 17
             $table->string('image')->nullable();
Please login to merge, or discard this patch.
src/app/Library/Uploaders/Uploader.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
     private bool $deleteWhenEntryIsDeleted = true;
27 27
 
28
-    private bool|string $attachedToFakeField = false;
28
+    private bool | string $attachedToFakeField = false;
29 29
 
30 30
     /**
31 31
      * Cloud disks have the ability to generate temporary URLs to files, should we do it?
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     /*******************************
63 63
      * Static methods
64 64
      *******************************/
65
-    public static function for(array $crudObject, array $definition): UploaderInterface
65
+    public static function for (array $crudObject, array $definition): UploaderInterface
66 66
     {
67 67
         return new static($crudObject, $definition);
68 68
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
     public function deleteUploadedFiles(Model $entry): void
104 104
     {
105
-        if (! in_array(SoftDeletes::class, class_uses_recursive($entry), true)) {
105
+        if (!in_array(SoftDeletes::class, class_uses_recursive($entry), true)) {
106 106
             $this->performFileDeletion($entry);
107 107
 
108 108
             return;
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 
178 178
     public function getPreviousFiles(Model $entry): mixed
179 179
     {
180
-        if (! $this->attachedToFakeField) {
180
+        if (!$this->attachedToFakeField) {
181 181
             return $this->getOriginalValue($entry);
182 182
         }
183 183
         $value = $this->getOriginalValue($entry, $this->attachedToFakeField);
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         return $this->attachedToFakeField !== false;
197 197
     }
198 198
 
199
-    public function getFakeAttribute(): bool|string
199
+    public function getFakeAttribute(): bool | string
200 200
     {
201 201
         return $this->attachedToFakeField;
202 202
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
         return $this;
224 224
     }
225 225
 
226
-    public function fake(bool|string $isFake): self
226
+    public function fake(bool | string $isFake): self
227 227
     {
228 228
         $this->attachedToFakeField = $isFake;
229 229
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         }
255 255
 
256 256
         if ($this->handleMultipleFiles) {
257
-            if (! isset($entry->getCasts()[$this->getName()]) && is_string($value)) {
257
+            if (!isset($entry->getCasts()[$this->getName()]) && is_string($value)) {
258 258
                 $entry->{$this->getAttributeName()} = json_decode($value, true);
259 259
             }
260 260
 
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
     protected function deleteFiles(Model $entry)
270 270
     {
271
-        if (! $this->shouldDeleteFiles()) {
271
+        if (!$this->shouldDeleteFiles()) {
272 272
             return;
273 273
         }
274 274
 
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     private function performFileDeletion(Model $entry)
305 305
     {
306
-        if (! $this->handleRepeatableFiles && $this->deleteWhenEntryIsDeleted) {
306
+        if (!$this->handleRepeatableFiles && $this->deleteWhenEntryIsDeleted) {
307 307
             $this->deleteFiles($entry);
308 308
 
309 309
             return;
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
         $previousValue = $entry->getOriginal($field);
334 334
 
335
-        if (! $previousValue) {
335
+        if (!$previousValue) {
336 336
             return $previousValue;
337 337
         }
338 338
 
Please login to merge, or discard this patch.
src/app/Console/Commands/PublishHeaderMetas.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         ];
61 61
 
62 62
         foreach ($filesToPublish as $destination => $stub) {
63
-            if (! is_string($destination)) {
63
+            if (!is_string($destination)) {
64 64
                 $destination = $stub;
65 65
                 $stub = null;
66 66
             }
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
                 continue;
72 72
             }
73 73
 
74
-            if (! File::isDirectory(dirname($destination))) {
74
+            if (!File::isDirectory(dirname($destination))) {
75 75
                 File::makeDirectory(dirname($destination), 0755, true);
76 76
             }
77 77
 
78
-            if (! $stub) {
78
+            if (!$stub) {
79 79
                 File::copy(__DIR__.'/../../../public/'.basename($destination), $destination);
80 80
                 $this->info("File {$destination} published.");
81 81
                 continue;
Please login to merge, or discard this patch.