We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | $fullPath = $this->basePath($relativePath); |
| 75 | 75 | |
| 76 | - if (! $this->files->exists($fullPath)) { |
|
| 76 | + if (!$this->files->exists($fullPath)) { |
|
| 77 | 77 | return null; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -86,13 +86,13 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | public function composerJson(): array |
| 88 | 88 | { |
| 89 | - if (! empty($this->composerJson)) { |
|
| 89 | + if (!empty($this->composerJson)) { |
|
| 90 | 90 | return $this->composerJson; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $content = $this->readFile('composer.json'); |
| 94 | 94 | |
| 95 | - if (! $content) { |
|
| 95 | + if (!$content) { |
|
| 96 | 96 | return $this->composerJson = []; |
| 97 | 97 | } |
| 98 | 98 | |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | public function installedPackageVersion(string $package): ?string |
| 137 | 137 | { |
| 138 | - if (! InstalledVersions::isInstalled($package)) { |
|
| 138 | + if (!InstalledVersions::isInstalled($package)) { |
|
| 139 | 139 | return null; |
| 140 | 140 | } |
| 141 | 141 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | public function installedPackagePrettyVersion(string $package): ?string |
| 146 | 146 | { |
| 147 | - if (! InstalledVersions::isInstalled($package)) { |
|
| 147 | + if (!InstalledVersions::isInstalled($package)) { |
|
| 148 | 148 | return null; |
| 149 | 149 | } |
| 150 | 150 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $pretty = $this->installedPackagePrettyVersion($package); |
| 157 | 157 | |
| 158 | - if (! $pretty) { |
|
| 158 | + if (!$pretty) { |
|
| 159 | 159 | return null; |
| 160 | 160 | } |
| 161 | 161 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | foreach ($directories as $directory) { |
| 184 | 184 | $absoluteDirectory = $this->resolvePath($directory); |
| 185 | 185 | |
| 186 | - if (! $this->files->isDirectory($absoluteDirectory)) { |
|
| 186 | + if (!$this->files->isDirectory($absoluteDirectory)) { |
|
| 187 | 187 | continue; |
| 188 | 188 | } |
| 189 | 189 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | $fullPath = $this->basePath($relativePath); |
| 249 | 249 | |
| 250 | 250 | try { |
| 251 | - if (! $this->files->exists($fullPath)) { |
|
| 251 | + if (!$this->files->exists($fullPath)) { |
|
| 252 | 252 | return true; |
| 253 | 253 | } |
| 254 | 254 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | { |
| 311 | 311 | $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); |
| 312 | 312 | |
| 313 | - if (! in_array($extension, $this->searchableExtensions, true)) { |
|
| 313 | + if (!in_array($extension, $this->searchableExtensions, true)) { |
|
| 314 | 314 | return true; |
| 315 | 315 | } |
| 316 | 316 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | public function canFix(StepResult $result): bool |
| 53 | 53 | { |
| 54 | - return $result->status === StepStatus::Warning && $this->currentContents !== null && ! empty($this->issues); |
|
| 54 | + return $result->status === StepStatus::Warning && $this->currentContents !== null && !empty($this->issues); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function fixMessage(StepResult $result): string |
@@ -92,11 +92,11 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $updated = preg_replace('/^base_path/m', ' base_path', $updated); |
| 94 | 94 | |
| 95 | - if (! $changed) { |
|
| 95 | + if (!$changed) { |
|
| 96 | 96 | return StepResult::failure('Could not adjust Tabler config automatically.'); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if (! $this->context()->writeFile($this->relativePath, $updated)) { |
|
| 99 | + if (!$this->context()->writeFile($this->relativePath, $updated)) { |
|
| 100 | 100 | return StepResult::failure('Failed writing changes to config/backpack/theme-tabler.php.'); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function run(): StepResult |
| 19 | 19 | { |
| 20 | - if (! $this->context()->fileExists($this->relativePath)) { |
|
| 20 | + if (!$this->context()->fileExists($this->relativePath)) { |
|
| 21 | 21 | return StepResult::success('Show operation view is not published, package default will be used.'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function fix(StepResult $result): StepResult |
| 41 | 41 | { |
| 42 | - if (! $this->context()->fileExists($this->relativePath)) { |
|
| 42 | + if (!$this->context()->fileExists($this->relativePath)) { |
|
| 43 | 43 | return StepResult::skipped('Published show.blade.php was already removed.'); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (! $this->context()->deleteFile($this->relativePath)) { |
|
| 46 | + if (!$this->context()->deleteFile($this->relativePath)) { |
|
| 47 | 47 | return StepResult::failure("Could not delete {$this->relativePath} automatically."); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | public function run(): StepResult |
| 19 | 19 | { |
| 20 | - if (! $this->context()->fileExists($this->relativePath)) { |
|
| 20 | + if (!$this->context()->fileExists($this->relativePath)) { |
|
| 21 | 21 | return StepResult::success('List operation view is not published, package default will be used.'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | public function fix(StepResult $result): StepResult |
| 41 | 41 | { |
| 42 | - if (! $this->context()->fileExists($this->relativePath)) { |
|
| 42 | + if (!$this->context()->fileExists($this->relativePath)) { |
|
| 43 | 43 | return StepResult::skipped('Published list.blade.php was already removed.'); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - if (! $this->context()->deleteFile($this->relativePath)) { |
|
| 46 | + if (!$this->context()->deleteFile($this->relativePath)) { |
|
| 47 | 47 | return StepResult::failure("Could not delete {$this->relativePath} automatically."); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | public function canFix(StepResult $result): bool |
| 43 | 43 | { |
| 44 | - if (! $result->status->isWarning()) { |
|
| 44 | + if (!$result->status->isWarning()) { |
|
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - return ! empty($this->crudControllerPaths()); |
|
| 48 | + return !empty($this->crudControllerPaths()); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function fixMessage(StepResult $result): string |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | continue; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - if (! $this->context()->writeFile($path, $updatedContents)) { |
|
| 80 | + if (!$this->context()->writeFile($path, $updatedContents)) { |
|
| 81 | 81 | return StepResult::failure("Could not update {$path} automatically."); |
| 82 | 82 | } |
| 83 | 83 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | foreach ($patterns as $pattern => $replacement) { |
| 109 | 109 | $contents = preg_replace_callback( |
| 110 | 110 | $pattern, |
| 111 | - function (array $matches) use (&$replacementCount, $replacement) { |
|
| 111 | + function(array $matches) use (&$replacementCount, $replacement) { |
|
| 112 | 112 | $replacementCount++; |
| 113 | 113 | |
| 114 | 114 | return $replacement($matches); |
@@ -134,19 +134,19 @@ discard block |
||
| 134 | 134 | private function wysiwygPatterns(): array |
| 135 | 135 | { |
| 136 | 136 | return [ |
| 137 | - '~->type\((["\'])wysiwyg\1\)~' => function (array $matches) { |
|
| 137 | + '~->type\((["\'])wysiwyg\1\)~' => function(array $matches) { |
|
| 138 | 138 | return '->type('.$matches[1].'ckeditor'.$matches[1].')'; |
| 139 | 139 | }, |
| 140 | - '~(["\']type["\']\s*=>\s*)(["\'])wysiwyg\2~' => function (array $matches) { |
|
| 140 | + '~(["\']type["\']\s*=>\s*)(["\'])wysiwyg\2~' => function(array $matches) { |
|
| 141 | 141 | return $matches[1].$matches[2].'ckeditor'.$matches[2]; |
| 142 | 142 | }, |
| 143 | - '~(CRUD::(?:addField|field|addColumn|column)\(\s*)(["\'])wysiwyg\2~' => function (array $matches) { |
|
| 143 | + '~(CRUD::(?:addField|field|addColumn|column)\(\s*)(["\'])wysiwyg\2~' => function(array $matches) { |
|
| 144 | 144 | return $matches[1].$matches[2].'ckeditor'.$matches[2]; |
| 145 | 145 | }, |
| 146 | - '~($this->crud->(?:addField|field|addColumn|column)\(\s*)(["\'])wysiwyg\2~' => function (array $matches) { |
|
| 146 | + '~($this->crud->(?:addField|field|addColumn|column)\(\s*)(["\'])wysiwyg\2~' => function(array $matches) { |
|
| 147 | 147 | return $matches[1].$matches[2].'ckeditor'.$matches[2]; |
| 148 | 148 | }, |
| 149 | - '~($crud->(?:addField|field|addColumn|column)\(\s*)(["\'])wysiwyg\2~' => function (array $matches) { |
|
| 149 | + '~($crud->(?:addField|field|addColumn|column)\(\s*)(["\'])wysiwyg\2~' => function(array $matches) { |
|
| 150 | 150 | return $matches[1].$matches[2].'ckeditor'.$matches[2]; |
| 151 | 151 | }, |
| 152 | 152 | ]; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | continue; |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if (! $this->matchesExpectedConstraint($constraint, $expectedConstraint)) { |
|
| 29 | + if (!$this->matchesExpectedConstraint($constraint, $expectedConstraint)) { |
|
| 30 | 30 | $this->mismatched[] = [ |
| 31 | 31 | 'package' => $package, |
| 32 | 32 | 'current' => $constraint, |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | public function canFix(StepResult $result): bool |
| 80 | 80 | { |
| 81 | - return $result->status === StepStatus::Warning && ! empty($this->mismatched); |
|
| 81 | + return $result->status === StepStatus::Warning && !empty($this->mismatched); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | public function fixMessage(StepResult $result): string |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $mismatched = $this->mismatched; |
| 96 | 96 | |
| 97 | - $updated = $this->context()->updateComposerJson(function (array &$composer) use ($mismatched) { |
|
| 97 | + $updated = $this->context()->updateComposerJson(function(array &$composer) use ($mismatched) { |
|
| 98 | 98 | foreach ($mismatched as $item) { |
| 99 | 99 | $section = $item['section'] ?? 'require'; |
| 100 | 100 | $composer[$section] = $composer[$section] ?? []; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | }); |
| 104 | 104 | |
| 105 | - if (! $updated) { |
|
| 105 | + if (!$updated) { |
|
| 106 | 106 | return StepResult::failure('Could not update composer.json automatically.'); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $detailLines = []; |
| 90 | 90 | |
| 91 | - if (! empty($this->missingPackages)) { |
|
| 91 | + if (!empty($this->missingPackages)) { |
|
| 92 | 92 | $detailLines[] = 'Missing editor packages (add to composer.json):'; |
| 93 | 93 | |
| 94 | 94 | foreach ($this->missingPackages as $package => $data) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - if (! empty($this->uninstalledPackages) && empty($this->missingPackages)) { |
|
| 100 | + if (!empty($this->uninstalledPackages) && empty($this->missingPackages)) { |
|
| 101 | 101 | $detailLines[] = 'Declared but not installed (run composer update):'; |
| 102 | 102 | |
| 103 | 103 | foreach ($this->uninstalledPackages as $package => $data) { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | 'uninstalled_packages' => array_keys($this->uninstalledPackages), |
| 112 | 112 | ]; |
| 113 | 113 | |
| 114 | - if (! empty($this->missingPackages)) { |
|
| 114 | + if (!empty($this->missingPackages)) { |
|
| 115 | 115 | return StepResult::failure( |
| 116 | 116 | 'Install the missing editor add-ons before continuing the upgrade.', |
| 117 | 117 | $detailLines, |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | public function canFix(StepResult $result): bool |
| 130 | 130 | { |
| 131 | - return $result->status === StepStatus::Failed && ! empty($this->missingPackages); |
|
| 131 | + return $result->status === StepStatus::Failed && !empty($this->missingPackages); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | public function fixMessage(StepResult $result): string |
@@ -144,19 +144,19 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | $missingPackages = $this->missingPackages; |
| 146 | 146 | |
| 147 | - $updated = $this->context()->updateComposerJson(function (array &$composer) use ($missingPackages) { |
|
| 147 | + $updated = $this->context()->updateComposerJson(function(array &$composer) use ($missingPackages) { |
|
| 148 | 148 | $composer['require'] = $composer['require'] ?? []; |
| 149 | 149 | |
| 150 | 150 | foreach ($missingPackages as $package => $data) { |
| 151 | 151 | $constraint = $data['constraint'] ?? 'dev-next'; |
| 152 | 152 | |
| 153 | - if (! array_key_exists($package, $composer['require'])) { |
|
| 153 | + if (!array_key_exists($package, $composer['require'])) { |
|
| 154 | 154 | $composer['require'][$package] = $constraint; |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | }); |
| 158 | 158 | |
| 159 | - if (! $updated) { |
|
| 159 | + if (!$updated) { |
|
| 160 | 160 | return StepResult::failure('Could not update composer.json automatically.'); |
| 161 | 161 | } |
| 162 | 162 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | $filtered = []; |
| 22 | 22 | |
| 23 | 23 | foreach ($paths as $path) { |
| 24 | - if (! $this->isCrudControllerPath($path)) { |
|
| 24 | + if (!$this->isCrudControllerPath($path)) { |
|
| 25 | 25 | continue; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | { |
| 24 | 24 | $format = $this->outputFormat(); |
| 25 | 25 | |
| 26 | - if (! in_array($format, ['cli', 'json'], true)) { |
|
| 26 | + if (!in_array($format, ['cli', 'json'], true)) { |
|
| 27 | 27 | $this->errorBlock(sprintf('Unknown output format "%s". Supported formats: cli, json.', $format)); |
| 28 | 28 | |
| 29 | 29 | return Command::INVALID; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $this->closeProgressBlock(strtoupper($fixResult->status->label()), $fixResult->status->color()); |
| 86 | 86 | $this->printResultDetails($fixResult); |
| 87 | 87 | |
| 88 | - if (! $fixResult->status->isFailure()) { |
|
| 88 | + if (!$fixResult->status->isFailure()) { |
|
| 89 | 89 | $this->progressBlock('Re-running '.$step->title()); |
| 90 | 90 | |
| 91 | 91 | try { |
@@ -131,14 +131,14 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $resultsCollection = collect($results); |
| 133 | 133 | |
| 134 | - $hasFailure = $resultsCollection->contains(function ($entry) { |
|
| 134 | + $hasFailure = $resultsCollection->contains(function($entry) { |
|
| 135 | 135 | /** @var StepResult $result */ |
| 136 | 136 | $result = $entry['result']; |
| 137 | 137 | |
| 138 | 138 | return $result->status->isFailure(); |
| 139 | 139 | }); |
| 140 | 140 | |
| 141 | - $warnings = $resultsCollection->filter(function ($entry) { |
|
| 141 | + $warnings = $resultsCollection->filter(function($entry) { |
|
| 142 | 142 | /** @var StepResult $result */ |
| 143 | 143 | $result = $entry['result']; |
| 144 | 144 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | if ($format === 'json') { |
| 149 | 149 | $payload = [ |
| 150 | 150 | 'version' => $majorVersion, |
| 151 | - 'results' => collect($results)->map(function ($entry) { |
|
| 151 | + 'results' => collect($results)->map(function($entry) { |
|
| 152 | 152 | /** @var StepResult $result */ |
| 153 | 153 | $result = $entry['result']; |
| 154 | 154 | |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $this->note(sprintf('%d step(s) reported warnings.', $warnings->count()), 'yellow', 'yellow'); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if (! $hasFailure && $warnings->isEmpty()) { |
|
| 183 | + if (!$hasFailure && $warnings->isEmpty()) { |
|
| 184 | 184 | $this->note('All checks passed, you are ready to continue with the manual steps from the upgrade guide.', 'green', 'green'); |
| 185 | 185 | } |
| 186 | 186 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $postUpgradeCommands = ($config)::postUpgradeCommands(); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - if ($expectedVersionInstalled && ! $hasFailure && ! empty($postUpgradeCommands)) { |
|
| 193 | + if ($expectedVersionInstalled && !$hasFailure && !empty($postUpgradeCommands)) { |
|
| 194 | 194 | $this->note("Now that you have v{$majorVersion} installed, don't forget to run the following commands:", 'green', 'green'); |
| 195 | 195 | |
| 196 | 196 | foreach ($postUpgradeCommands as $command) { |
@@ -229,11 +229,11 @@ discard block |
||
| 229 | 229 | return false; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - if (! $this->input->isInteractive()) { |
|
| 232 | + if (!$this->input->isInteractive()) { |
|
| 233 | 233 | return false; |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | - if (! in_array($result->status, [StepStatus::Warning, StepStatus::Failed], true)) { |
|
| 236 | + if (!in_array($result->status, [StepStatus::Warning, StepStatus::Failed], true)) { |
|
| 237 | 237 | return false; |
| 238 | 238 | } |
| 239 | 239 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | { |
| 252 | 252 | $configProviderClass = sprintf('%s\\v%s\\UpgradeCommandConfig', __NAMESPACE__, $majorVersion); |
| 253 | 253 | |
| 254 | - if (! class_exists($configProviderClass)) { |
|
| 254 | + if (!class_exists($configProviderClass)) { |
|
| 255 | 255 | throw new RuntimeException(sprintf( |
| 256 | 256 | 'Missing upgrade config provider for Backpack v%s. Please create %s.', |
| 257 | 257 | $majorVersion, |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | ? $this->laravel->make($configProviderClass) |
| 264 | 264 | : new $configProviderClass(); |
| 265 | 265 | |
| 266 | - if (! $provider instanceof UpgradeConfigInterface) { |
|
| 266 | + if (!$provider instanceof UpgradeConfigInterface) { |
|
| 267 | 267 | throw new RuntimeException(sprintf( |
| 268 | 268 | 'Upgrade config provider [%s] must implement %s.', |
| 269 | 269 | $configProviderClass, |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | |
| 274 | 274 | $steps = $provider->steps(); |
| 275 | 275 | |
| 276 | - if (! is_array($steps)) { |
|
| 276 | + if (!is_array($steps)) { |
|
| 277 | 277 | throw new RuntimeException(sprintf( |
| 278 | 278 | 'Upgrade config provider [%s] must return an array of step class names.', |
| 279 | 279 | $configProviderClass |