We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -78,13 +78,13 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $detailLines = []; |
| 80 | 80 | |
| 81 | - if (! empty($this->missingPackages)) { |
|
| 81 | + if (!empty($this->missingPackages)) { |
|
| 82 | 82 | foreach ($this->missingPackages as $package => $data) { |
| 83 | 83 | $detailLines[] = sprintf('- %s (%s field/column usage detected)', $package, $data['keyword']); |
| 84 | 84 | } |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - if (! empty($this->uninstalledPackages) && empty($this->missingPackages)) { |
|
| 87 | + if (!empty($this->uninstalledPackages) && empty($this->missingPackages)) { |
|
| 88 | 88 | foreach ($this->uninstalledPackages as $package => $data) { |
| 89 | 89 | $detailLines[] = sprintf('- %s (%s field/column usage detected)', $package, $data['keyword']); |
| 90 | 90 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'uninstalled_packages' => array_keys($this->uninstalledPackages), |
| 96 | 96 | ]; |
| 97 | 97 | |
| 98 | - if (! empty($this->missingPackages)) { |
|
| 98 | + if (!empty($this->missingPackages)) { |
|
| 99 | 99 | return StepResult::failure( |
| 100 | 100 | 'There are missing editor packages required by your CrudControllers.', |
| 101 | 101 | $detailLines, |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | public function canFix(StepResult $result): bool |
| 114 | 114 | { |
| 115 | - return $result->status === StepStatus::Failed && ! empty($this->missingPackages); |
|
| 115 | + return $result->status === StepStatus::Failed && !empty($this->missingPackages); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | public function fixMessage(StepResult $result): string |
@@ -128,19 +128,19 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | $missingPackages = $this->missingPackages; |
| 130 | 130 | |
| 131 | - $updated = $this->context()->updateComposerJson(function (array &$composer) use ($missingPackages) { |
|
| 131 | + $updated = $this->context()->updateComposerJson(function(array &$composer) use ($missingPackages) { |
|
| 132 | 132 | $composer['require'] = $composer['require'] ?? []; |
| 133 | 133 | |
| 134 | 134 | foreach ($missingPackages as $package => $data) { |
| 135 | 135 | $constraint = $data['constraint'] ?? 'dev-next'; |
| 136 | 136 | |
| 137 | - if (! array_key_exists($package, $composer['require'])) { |
|
| 137 | + if (!array_key_exists($package, $composer['require'])) { |
|
| 138 | 138 | $composer['require'][$package] = $constraint; |
| 139 | 139 | } |
| 140 | 140 | } |
| 141 | 141 | }); |
| 142 | 142 | |
| 143 | - if (! $updated) { |
|
| 143 | + if (!$updated) { |
|
| 144 | 144 | return StepResult::failure('Could not update composer.json automatically.'); |
| 145 | 145 | } |
| 146 | 146 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $issues = []; |
| 33 | 33 | |
| 34 | - if (! $this->configs->configFilesPublished()) { |
|
| 34 | + if (!$this->configs->configFilesPublished()) { |
|
| 35 | 35 | return StepResult::skipped('Operation config files are not published.'); |
| 36 | 36 | } |
| 37 | 37 | |
@@ -60,11 +60,11 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function canFix(StepResult $result): bool |
| 62 | 62 | { |
| 63 | - if (! $result->status->isWarning()) { |
|
| 63 | + if (!$result->status->isWarning()) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return ! empty($this->configs->topLevelEntriesPerFile()); |
|
| 67 | + return !empty($this->configs->topLevelEntriesPerFile()); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | public function fixMessage(StepResult $result): string |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | return StepResult::failure("Could not locate {$displayPath} on disk."); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! $this->configs->addEntriesToPublishedFile($absolutePath, $entries, $error)) { |
|
| 99 | + if (!$this->configs->addEntriesToPublishedFile($absolutePath, $entries, $error)) { |
|
| 100 | 100 | return StepResult::failure($error ?? "Could not update {$displayPath} automatically."); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -27,18 +27,18 @@ discard block |
||
| 27 | 27 | $this->legacyFiles = []; |
| 28 | 28 | $this->legacyDirectoryDetected = false; |
| 29 | 29 | |
| 30 | - if (! $this->context()->hasComposerPackage('backpack/filemanager')) { |
|
| 30 | + if (!$this->context()->hasComposerPackage('backpack/filemanager')) { |
|
| 31 | 31 | return StepResult::success('File Manager add-on not detected; no published views to review.'); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if (! $this->context()->fileExists(self::LEGACY_VIEWS_DIRECTORY)) { |
|
| 34 | + if (!$this->context()->fileExists(self::LEGACY_VIEWS_DIRECTORY)) { |
|
| 35 | 35 | return StepResult::success('No File Manager views found in resources/views/vendor/elfinder.'); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $filesystem = new Filesystem(); |
| 39 | 39 | $absoluteDirectory = $this->context()->basePath(self::LEGACY_VIEWS_DIRECTORY); |
| 40 | 40 | |
| 41 | - if (! $filesystem->isDirectory($absoluteDirectory)) { |
|
| 41 | + if (!$filesystem->isDirectory($absoluteDirectory)) { |
|
| 42 | 42 | return StepResult::success('No File Manager views found in resources/views/vendor/elfinder.'); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | public function canFix(StepResult $result): bool |
| 61 | 61 | { |
| 62 | - if (! $result->status->isWarning()) { |
|
| 62 | + if (!$result->status->isWarning()) { |
|
| 63 | 63 | return false; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -73,12 +73,12 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function fix(StepResult $result): StepResult |
| 75 | 75 | { |
| 76 | - if (! $this->legacyDirectoryDetected) { |
|
| 76 | + if (!$this->legacyDirectoryDetected) { |
|
| 77 | 77 | return StepResult::skipped('Legacy File Manager directory no longer present.'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | foreach ($this->legacyFiles as $path) { |
| 81 | - if (! $this->context()->deleteFile($path)) { |
|
| 81 | + if (!$this->context()->deleteFile($path)) { |
|
| 82 | 82 | return StepResult::failure("Could not delete {$path} automatically."); |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $filesystem = new Filesystem(); |
| 87 | 87 | $absoluteDirectory = $this->context()->basePath(self::LEGACY_VIEWS_DIRECTORY); |
| 88 | 88 | |
| 89 | - if ($filesystem->isDirectory($absoluteDirectory) && ! $filesystem->deleteDirectory($absoluteDirectory)) { |
|
| 89 | + if ($filesystem->isDirectory($absoluteDirectory) && !$filesystem->deleteDirectory($absoluteDirectory)) { |
|
| 90 | 90 | return StepResult::failure('Could not delete resources/views/vendor/elfinder automatically.'); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $this->missingComponent = false; |
| 38 | 38 | |
| 39 | - if (! $this->configs->configFilesPublished()) { |
|
| 39 | + if (!$this->configs->configFilesPublished()) { |
|
| 40 | 40 | return StepResult::skipped('show.php config file is not published, core defaults already use the new datagrid component.'); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! $this->configs->publishedFileContainsKey($this->operationFilename, 'component')) { |
|
| 43 | + if (!$this->configs->publishedFileContainsKey($this->operationFilename, 'component')) { |
|
| 44 | 44 | $this->missingComponent = true; |
| 45 | 45 | |
| 46 | 46 | return StepResult::warning( |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | public function fix(StepResult $result): StepResult |
| 65 | 65 | { |
| 66 | - if (! $this->configs->configFilesPublished()) { |
|
| 66 | + if (!$this->configs->configFilesPublished()) { |
|
| 67 | 67 | return StepResult::skipped('show.php config file is not published, core defaults already use the new datagrid component.'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | $error = null; |
| 79 | 79 | |
| 80 | - if (! $this->configs->addKeyToConfigFile($this->operationFilename, $snippet, $error)) { |
|
| 80 | + if (!$this->configs->addKeyToConfigFile($this->operationFilename, $snippet, $error)) { |
|
| 81 | 81 | return StepResult::failure($error ?? 'Could not update show.php automatically.'); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | public function canFix(StepResult $result): bool |
| 60 | 60 | { |
| 61 | 61 | return $result->status === StepStatus::Warning |
| 62 | - && ($this->needsPublish || ($this->currentContents !== null && ! empty($this->issues))); |
|
| 62 | + && ($this->needsPublish || ($this->currentContents !== null && !empty($this->issues))); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | public function fixMessage(StepResult $result): string |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $pattern = '~^[\t ]*'.preg_quote($target, '~').'([\t ]*,?[\t ]*)\r?$~m'; |
| 98 | 98 | $new = preg_replace_callback( |
| 99 | 99 | $pattern, |
| 100 | - function (array $matches) use ($target) { |
|
| 100 | + function(array $matches) use ($target) { |
|
| 101 | 101 | $position = strpos($matches[0], $target); |
| 102 | 102 | $indentation = $position === false ? '' : substr($matches[0], 0, $position); |
| 103 | 103 | |
@@ -116,11 +116,11 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - if (! $changed) { |
|
| 119 | + if (!$changed) { |
|
| 120 | 120 | return StepResult::failure('Could not adjust Tabler config automatically.'); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (! $this->context()->writeFile($this->relativePath, $updated)) { |
|
| 123 | + if (!$this->context()->writeFile($this->relativePath, $updated)) { |
|
| 124 | 124 | return StepResult::failure('Failed writing changes to config/backpack/theme-tabler.php.'); |
| 125 | 125 | } |
| 126 | 126 | |
@@ -30,7 +30,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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; |
@@ -102,7 +102,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |