We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 | |
@@ -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 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | // Install Backpack Generators |
| 85 | 85 | $this->progressBlock('Installing Generators'); |
| 86 | - if (! file_exists('vendor/backpack/generators/composer.json')) { |
|
| 86 | + if (!file_exists('vendor/backpack/generators/composer.json')) { |
|
| 87 | 87 | // only do this if Generators aren't already required |
| 88 | 88 | $process = new Process(['composer', 'require', '--dev', 'backpack/generators']); |
| 89 | 89 | $process->setTimeout(300); |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $this->closeProgressBlock(); |
| 98 | 98 | |
| 99 | 99 | // Optional commands |
| 100 | - if (! $this->option('no-interaction')) { |
|
| 100 | + if (!$this->option('no-interaction')) { |
|
| 101 | 101 | // Themes |
| 102 | 102 | $this->installTheme(); |
| 103 | 103 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // Addons |
| 108 | 108 | $this->installAddons(); |
| 109 | - } elseif (! $this->isAnyThemeInstalled()) { |
|
| 109 | + } elseif (!$this->isAnyThemeInstalled()) { |
|
| 110 | 110 | // Install default theme |
| 111 | 111 | $this->progressBlock('Installing default theme'); |
| 112 | 112 | $this->executeArtisanProcess('backpack:require:theme-tabler'); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | //execute basset checks |
| 117 | - if (! $this->option('skip-basset-check')) { |
|
| 117 | + if (!$this->option('skip-basset-check')) { |
|
| 118 | 118 | $this->progressBlock('Running Basset checks'); |
| 119 | 119 | $this->executeArtisanProcess('basset:check'); |
| 120 | 120 | $this->closeProgressBlock(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $this->deleteLines(3); |
| 195 | 195 | |
| 196 | - if (! $total) { |
|
| 196 | + if (!$total) { |
|
| 197 | 197 | $this->deleteLines(); |
| 198 | 198 | $this->note('Skipping creating an admin user.'); |
| 199 | 199 | $this->newLine(); |
@@ -202,14 +202,14 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | private function isEveryAddonInstalled() |
| 204 | 204 | { |
| 205 | - return collect($this->addons)->every(function ($addon) { |
|
| 205 | + return collect($this->addons)->every(function($addon) { |
|
| 206 | 206 | return file_exists($addon->path); |
| 207 | 207 | }); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | private function updateAddonsStatus() |
| 211 | 211 | { |
| 212 | - $this->addons = $this->addons->each(function (&$addon) { |
|
| 212 | + $this->addons = $this->addons->each(function(&$addon) { |
|
| 213 | 213 | $isInstalled = file_exists($addon->path); |
| 214 | 214 | $addon->status = $isInstalled ? 'installed' : 'not installed'; |
| 215 | 215 | $addon->statusColor = $isInstalled ? 'green' : 'yellow'; |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | { |
| 221 | 221 | // map the addons |
| 222 | 222 | $this->addons = collect($this->addons) |
| 223 | - ->map(function ($class) { |
|
| 223 | + ->map(function($class) { |
|
| 224 | 224 | return (object) $class::$addon; |
| 225 | 225 | }); |
| 226 | 226 | |
@@ -239,15 +239,15 @@ discard block |
||
| 239 | 239 | |
| 240 | 240 | // Calculate the printed line count |
| 241 | 241 | $printedLines = $this->addons |
| 242 | - ->map(function ($e) { |
|
| 242 | + ->map(function($e) { |
|
| 243 | 243 | return count($e->description); |
| 244 | 244 | }) |
| 245 | - ->reduce(function ($sum, $item) { |
|
| 245 | + ->reduce(function($sum, $item) { |
|
| 246 | 246 | return $sum + $item + 2; |
| 247 | 247 | }, 0); |
| 248 | 248 | |
| 249 | 249 | $total = 0; |
| 250 | - while (! $this->isEveryAddonInstalled()) { |
|
| 250 | + while (!$this->isEveryAddonInstalled()) { |
|
| 251 | 251 | $input = (int) $this->listChoice('Would you like to install a premium Backpack add-on? <fg=gray>(enter an option number from above or press any other key to continue the installation)</>', $this->addons->toArray()); |
| 252 | 252 | |
| 253 | 253 | if ($input < 1 || $input > $this->addons->count()) { |
@@ -282,14 +282,14 @@ discard block |
||
| 282 | 282 | |
| 283 | 283 | private function isEveryThemeInstalled() |
| 284 | 284 | { |
| 285 | - return $this->themes()->every(function ($theme) { |
|
| 285 | + return $this->themes()->every(function($theme) { |
|
| 286 | 286 | return $theme->status == 'installed'; |
| 287 | 287 | }); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | private function isAnyThemeInstalled() |
| 291 | 291 | { |
| 292 | - return $this->themes()->filter(function ($theme) { |
|
| 292 | + return $this->themes()->filter(function($theme) { |
|
| 293 | 293 | return $theme->status == 'installed'; |
| 294 | 294 | })->count() > 0; |
| 295 | 295 | } |
@@ -307,10 +307,10 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | // Calculate the printed line count |
| 309 | 309 | $printedLines = $this->themes() |
| 310 | - ->map(function ($e) { |
|
| 310 | + ->map(function($e) { |
|
| 311 | 311 | return count($e->description); |
| 312 | 312 | }) |
| 313 | - ->reduce(function ($sum, $item) { |
|
| 313 | + ->reduce(function($sum, $item) { |
|
| 314 | 314 | return $sum + $item + 2; |
| 315 | 315 | }, 0); |
| 316 | 316 | |
@@ -346,9 +346,9 @@ discard block |
||
| 346 | 346 | public function themes() |
| 347 | 347 | { |
| 348 | 348 | return collect($this->themes) |
| 349 | - ->map(function ($class) { |
|
| 349 | + ->map(function($class) { |
|
| 350 | 350 | return (object) $class::$addon; |
| 351 | - })->each(function (&$theme) { |
|
| 351 | + })->each(function(&$theme) { |
|
| 352 | 352 | $isInstalled = file_exists($theme->path); |
| 353 | 353 | $theme->status = $isInstalled ? 'installed' : 'not installed'; |
| 354 | 354 | $theme->statusColor = $isInstalled ? 'green' : 'yellow'; |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | |
| 61 | 61 | public function upgradeCommandDescription(): ?callable |
| 62 | 62 | { |
| 63 | - return function (UpgradeCommand $command): void { |
|
| 63 | + return function(UpgradeCommand $command): void { |
|
| 64 | 64 | $command->note( |
| 65 | 65 | 'Before you start, make sure you have a fresh <fg=red>FULL BACKUP</> of your project and database stored safely.', |
| 66 | 66 | 'yellow', |
@@ -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 | |