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
Push — add-update-command ( a799e0...85addd )
by Cristian
30:23 queued 15:39
created
src/app/Console/Commands/Upgrade/Support/ConfigFilesHelper.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             return;
31 31
         }
32 32
 
33
-        if (! isset($this->publishedRoot)) {
33
+        if (!isset($this->publishedRoot)) {
34 34
             return;
35 35
         }
36 36
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
         $absolutePath = $this->resolvePublishedPath($path);
55 55
 
56
-        if (! is_file($absolutePath)) {
56
+        if (!is_file($absolutePath)) {
57 57
             return null;
58 58
         }
59 59
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
     public function analyzeConfigFile(string $path): ?array
81 81
     {
82
-        if (! is_file($path)) {
82
+        if (!is_file($path)) {
83 83
             return null;
84 84
         }
85 85
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
             $missingKeys = $analysis['missing_keys'] ?? [];
172 172
 
173
-            if (! empty($missingKeys)) {
173
+            if (!empty($missingKeys)) {
174 174
                 $missingKeysPerFile[$displayPath] = $missingKeys;
175 175
             }
176 176
 
@@ -189,16 +189,16 @@  discard block
 block discarded – undo
189 189
                     continue;
190 190
                 }
191 191
 
192
-                if (! isset($entriesByKey[$key])) {
192
+                if (!isset($entriesByKey[$key])) {
193 193
                     $entriesByKey[$key] = $entry;
194 194
                 }
195 195
 
196
-                if (! isset($collectedEntries[$key])) {
196
+                if (!isset($collectedEntries[$key])) {
197 197
                     $collectedEntries[$key] = $entry;
198 198
                 }
199 199
             }
200 200
 
201
-            if (! empty($entriesByKey)) {
201
+            if (!empty($entriesByKey)) {
202 202
                 $topLevelEntriesPerFile[$displayPath] = array_values($entriesByKey);
203 203
                 $topLevelMissingKeysPerFile[$displayPath] = array_keys($entriesByKey);
204 204
             }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 
247 247
     public function loadConfigArray(string $path): ?array
248 248
     {
249
-        if (! is_file($path)) {
249
+        if (!is_file($path)) {
250 250
             return null;
251 251
         }
252 252
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             throw new \InvalidArgumentException('Published directory path must not be empty.');
305 305
         }
306 306
 
307
-        $this->publishedIsFile = ! is_dir($this->publishedRoot);
307
+        $this->publishedIsFile = !is_dir($this->publishedRoot);
308 308
         $this->configFiles = [];
309 309
     }
310 310
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             throw new \InvalidArgumentException('Package directory path must not be empty.');
317 317
         }
318 318
 
319
-        $this->packageIsFile = ! is_dir($this->packageRoot);
319
+        $this->packageIsFile = !is_dir($this->packageRoot);
320 320
         $this->configFiles = [];
321 321
     }
322 322
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 $normalized[] = rtrim($line, "\r");
367 367
             }
368 368
 
369
-            if (! empty($normalized)) {
369
+            if (!empty($normalized)) {
370 370
                 $blocks[] = implode(PHP_EOL, $normalized);
371 371
             }
372 372
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
         $after = substr($contents, $closingPosition);
411 411
 
412 412
         $configArray = $this->loadPublishedConfig($path);
413
-        $shouldEnsureTrailingComma = $configArray === null ? true : ! empty($configArray);
413
+        $shouldEnsureTrailingComma = $configArray === null ? true : !empty($configArray);
414 414
 
415 415
         if ($shouldEnsureTrailingComma) {
416 416
             $before = $this->ensureTrailingComma($before);
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 
426 426
         $updated = $before.$snippet.$after;
427 427
 
428
-        if (! $this->writePublishedFile($path, $updated)) {
428
+        if (!$this->writePublishedFile($path, $updated)) {
429 429
             $error = sprintf('Could not update %s automatically.', $this->publishedRelativePath($path));
430 430
 
431 431
             return false;
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
             return false;
464 464
         }
465 465
 
466
-        if (! $this->writePublishedFile($path, $updatedContents)) {
466
+        if (!$this->writePublishedFile($path, $updatedContents)) {
467 467
             $error = sprintf('Could not save the updated %s configuration.', $this->publishedRelativePath($path));
468 468
 
469 469
             return false;
@@ -540,7 +540,7 @@  discard block
 block discarded – undo
540 540
             break;
541 541
         }
542 542
 
543
-        if (! $modified) {
543
+        if (!$modified) {
544 544
             return $before;
545 545
         }
546 546
 
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
     {
558 558
         $packagePath = $this->packagePathFor($path);
559 559
 
560
-        if (! is_file($packagePath)) {
560
+        if (!is_file($packagePath)) {
561 561
             return [];
562 562
         }
563 563
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
             $line = rtrim($lines[$index], "\r");
578 578
             $trimmed = ltrim($line);
579 579
 
580
-            if (! $withinConfigArray) {
580
+            if (!$withinConfigArray) {
581 581
                 if (preg_match('/return\s*\[/', $trimmed)) {
582 582
                     $withinConfigArray = true;
583 583
                 }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
             if ($this->isBlockCommentStart($trimmed)) {
594 594
                 $pendingComments[] = $line;
595 595
 
596
-                while (! str_contains($trimmed, '*/') && $index + 1 < $lineCount) {
596
+                while (!str_contains($trimmed, '*/') && $index + 1 < $lineCount) {
597 597
                     $index++;
598 598
                     $line = rtrim($lines[$index], "\r");
599 599
                     $trimmed = ltrim($line);
@@ -610,13 +610,13 @@  discard block
 block discarded – undo
610 610
                 continue;
611 611
             }
612 612
 
613
-            if ($trimmed === '' && ! empty($pendingComments)) {
613
+            if ($trimmed === '' && !empty($pendingComments)) {
614 614
                 $pendingComments[] = $line;
615 615
                 $index++;
616 616
                 continue;
617 617
             }
618 618
 
619
-            if (! preg_match('/^([\'"])\s*(.+?)\1\s*=>/', $trimmed, $matches)) {
619
+            if (!preg_match('/^([\'"])\s*(.+?)\1\s*=>/', $trimmed, $matches)) {
620 620
                 $pendingComments = [];
621 621
                 $index++;
622 622
                 continue;
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
             $valueDepth = $this->calculateBracketDelta($line);
629 629
             $hasTerminatingComma = $this->lineHasTerminatingComma($line);
630 630
 
631
-            while (($valueDepth > 0 || ! $hasTerminatingComma) && $index + 1 < $lineCount) {
631
+            while (($valueDepth > 0 || !$hasTerminatingComma) && $index + 1 < $lineCount) {
632 632
                 $index++;
633 633
                 $line = rtrim($lines[$index], "\r");
634 634
                 $entryLines[] = $line;
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         $files = [];
656 656
 
657 657
         foreach ($definitions as $definition) {
658
-            if (! is_string($definition)) {
658
+            if (!is_string($definition)) {
659 659
                 continue;
660 660
             }
661 661
 
@@ -873,13 +873,13 @@  discard block
 block discarded – undo
873 873
         for ($i = 0; $i < $length; $i++) {
874 874
             $char = $line[$i];
875 875
 
876
-            if ($char === '\'' && ! $inDouble && ! $this->isCharacterEscaped($line, $i)) {
877
-                $inSingle = ! $inSingle;
876
+            if ($char === '\'' && !$inDouble && !$this->isCharacterEscaped($line, $i)) {
877
+                $inSingle = !$inSingle;
878 878
                 continue;
879 879
             }
880 880
 
881
-            if ($char === '"' && ! $inSingle && ! $this->isCharacterEscaped($line, $i)) {
882
-                $inDouble = ! $inDouble;
881
+            if ($char === '"' && !$inSingle && !$this->isCharacterEscaped($line, $i)) {
882
+                $inDouble = !$inDouble;
883 883
                 continue;
884 884
             }
885 885
 
@@ -914,17 +914,17 @@  discard block
 block discarded – undo
914 914
         for ($i = 0; $i < $length; $i++) {
915 915
             $char = $line[$i];
916 916
 
917
-            if ($char === '\'' && ! $inDouble) {
918
-                if (! $this->isCharacterEscaped($line, $i)) {
919
-                    $inSingle = ! $inSingle;
917
+            if ($char === '\'' && !$inDouble) {
918
+                if (!$this->isCharacterEscaped($line, $i)) {
919
+                    $inSingle = !$inSingle;
920 920
                 }
921 921
 
922 922
                 continue;
923 923
             }
924 924
 
925
-            if ($char === '"' && ! $inSingle) {
926
-                if (! $this->isCharacterEscaped($line, $i)) {
927
-                    $inDouble = ! $inDouble;
925
+            if ($char === '"' && !$inSingle) {
926
+                if (!$this->isCharacterEscaped($line, $i)) {
927
+                    $inDouble = !$inDouble;
928 928
                 }
929 929
 
930 930
                 continue;
Please login to merge, or discard this patch.
src/app/Console/Commands/Upgrade/UpgradeCommand.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     $this->closeProgressBlock(strtoupper($fixResult->status->label()), $fixResult->status->color());
103 103
                     $this->printResultDetails($fixResult);
104 104
 
105
-                    if (! $fixResult->status->isFailure()) {
105
+                    if (!$fixResult->status->isFailure()) {
106 106
                         $this->progressBlock('Re-running '.$step->title());
107 107
 
108 108
                         try {
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
     ): int {
143 143
         $resultsCollection = collect($results);
144 144
 
145
-        $hasFailure = $resultsCollection->contains(function ($entry) {
145
+        $hasFailure = $resultsCollection->contains(function($entry) {
146 146
             /** @var StepResult $result */
147 147
             $result = $entry['result'];
148 148
 
149 149
             return $result->status->isFailure();
150 150
         });
151 151
 
152
-        $warnings = $resultsCollection->filter(function ($entry) {
152
+        $warnings = $resultsCollection->filter(function($entry) {
153 153
             /** @var StepResult $result */
154 154
             $result = $entry['result'];
155 155
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         });
158 158
 
159 159
         $failedTitles = $resultsCollection
160
-            ->filter(function ($entry) {
160
+            ->filter(function($entry) {
161 161
                 /** @var StepResult $result */
162 162
                 $result = $entry['result'];
163 163
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $this->note('At least one step reported a failure. Review the messages above before continuing.', 'red', 'red');
177 177
         }
178 178
 
179
-        if (! $hasFailure && $warnings->isEmpty()) {
179
+        if (!$hasFailure && $warnings->isEmpty()) {
180 180
             $this->note('All checks passed, you are ready to continue with the manual steps from the upgrade guide.', 'green', 'green');
181 181
         }
182 182
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             $postUpgradeCommands = ($config)::postUpgradeCommands();
203 203
         }
204 204
 
205
-        if ($expectedVersionInstalled && ! $hasFailure && ! empty($postUpgradeCommands)) {
205
+        if ($expectedVersionInstalled && !$hasFailure && !empty($postUpgradeCommands)) {
206 206
             $this->note("Now that you have {$versionLabel} installed, don't forget to run the following commands:", 'green', 'green');
207 207
 
208 208
             foreach ($postUpgradeCommands as $command) {
@@ -237,11 +237,11 @@  discard block
 block discarded – undo
237 237
 
238 238
     protected function shouldOfferFix(Step $step, StepResult $result): bool
239 239
     {
240
-        if (! $this->input->isInteractive()) {
240
+        if (!$this->input->isInteractive()) {
241 241
             return false;
242 242
         }
243 243
 
244
-        if (! in_array($result->status, [StepStatus::Warning, StepStatus::Failed], true)) {
244
+        if (!in_array($result->status, [StepStatus::Warning, StepStatus::Failed], true)) {
245 245
             return false;
246 246
         }
247 247
 
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
 
259 259
         $configProviderClass = sprintf('%s\\%s\\UpgradeCommandConfig', __NAMESPACE__, $descriptor['namespace']);
260 260
 
261
-        if (! class_exists($configProviderClass)) {
261
+        if (!class_exists($configProviderClass)) {
262 262
             $this->manuallyLoadConfigDirectory($descriptor);
263 263
         }
264 264
 
265
-        if (! class_exists($configProviderClass)) {
265
+        if (!class_exists($configProviderClass)) {
266 266
             throw new RuntimeException(sprintf(
267 267
                 'Missing upgrade config provider for Backpack %s. Please create %s.',
268 268
                 $descriptor['label'],
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
             ? $this->laravel->make($configProviderClass)
275 275
             : new $configProviderClass();
276 276
 
277
-        if (! $provider instanceof UpgradeConfigInterface) {
277
+        if (!$provider instanceof UpgradeConfigInterface) {
278 278
             throw new RuntimeException(sprintf(
279 279
                 'Upgrade config provider [%s] must implement %s.',
280 280
                 $configProviderClass,
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
         $steps = $provider->steps();
286 286
 
287
-        if (! is_array($steps)) {
287
+        if (!is_array($steps)) {
288 288
             throw new RuntimeException(sprintf(
289 289
                 'Upgrade config provider [%s] must return an array of step class names.',
290 290
                 $configProviderClass
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                 $singleDescriptor = $sorted[0];
337 337
                 $singleConfig = $this->resolveConfigForDescriptor($singleDescriptor);
338 338
 
339
-                if (! $this->descriptorHasSteps($singleConfig)) {
339
+                if (!$this->descriptorHasSteps($singleConfig)) {
340 340
                     if ($this->displayDescriptorDescription($singleDescriptor, $singleConfig)) {
341 341
                         $this->newLine();
342 342
                     }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                 $hasSteps = $this->descriptorHasSteps($config);
355 355
                 $summary = $hasSteps ? $this->descriptorChoiceSummary($descriptor, $config) : null;
356 356
 
357
-                if (! $hasSteps) {
357
+                if (!$hasSteps) {
358 358
                     if ($this->displayDescriptorDescription($descriptor, $config)) {
359 359
                         $this->newLine();
360 360
                     }
@@ -460,13 +460,13 @@  discard block
 block discarded – undo
460 460
             return $this->descriptorChoiceSummaries[$key];
461 461
         }
462 462
 
463
-        if (! $config instanceof UpgradeConfigSummaryInterface) {
463
+        if (!$config instanceof UpgradeConfigSummaryInterface) {
464 464
             return $this->descriptorChoiceSummaries[$key] = null;
465 465
         }
466 466
 
467 467
         $summary = $config->upgradeCommandSummary();
468 468
 
469
-        if (! is_string($summary)) {
469
+        if (!is_string($summary)) {
470 470
             return $this->descriptorChoiceSummaries[$key] = null;
471 471
         }
472 472
 
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 
506 506
         try {
507 507
             $description($this);
508
-        } catch (\ArgumentCountError|\TypeError $exception) {
508
+        } catch (\ArgumentCountError | \TypeError $exception) {
509 509
             if ($description instanceof \Closure) {
510 510
                 $description->call($this);
511 511
 
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 
537 537
             $configPath = $directory.DIRECTORY_SEPARATOR.'UpgradeCommandConfig.php';
538 538
 
539
-            if (! $filesystem->exists($configPath)) {
539
+            if (!$filesystem->exists($configPath)) {
540 540
                 continue;
541 541
             }
542 542
 
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
     {
597 597
         $list = array_values($descriptors);
598 598
 
599
-        usort($list, function (array $a, array $b) use ($direction) {
599
+        usort($list, function(array $a, array $b) use ($direction) {
600 600
             $comparison = version_compare($a['comparable'], $b['comparable']);
601 601
 
602 602
             return $direction === 'desc' ? -$comparison : $comparison;
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
     protected function installedBackpackPrettyVersion(): ?string
637 637
     {
638 638
         try {
639
-            if (! InstalledVersions::isInstalled('backpack/crud')) {
639
+            if (!InstalledVersions::isInstalled('backpack/crud')) {
640 640
                 return null;
641 641
             }
642 642
         } catch (OutOfBoundsException $exception) {
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
 
690 690
     protected function segmentsToComparable(array $segments): string
691 691
     {
692
-        return implode('.', array_map(static function ($segment) {
692
+        return implode('.', array_map(static function($segment) {
693 693
             return (string) (int) $segment;
694 694
         }, $segments));
695 695
     }
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 
708 708
         $stepsPath = $basePath.DIRECTORY_SEPARATOR.'Steps';
709 709
 
710
-        if (! $filesystem->isDirectory($stepsPath)) {
710
+        if (!$filesystem->isDirectory($stepsPath)) {
711 711
             return;
712 712
         }
713 713
 
Please login to merge, or discard this patch.