for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
<?php
namespace Backpack\CRUD\app\Console\Commands\Upgrade\Concerns;
use Backpack\CRUD\app\Console\Commands\Upgrade\UpgradeContext;
/**
* @mixin \Backpack\CRUD\app\Console\Commands\Upgrade\Step
*/
trait InteractsWithCrudControllers
{
* Filter a list of file paths to those that look like CrudControllers and optionally validate contents.
protected function filterCrudControllerPaths(array $paths, ?callable $contentsValidator = null): array
if (empty($paths)) {
return [];
}
$filtered = [];
foreach ($paths as $path) {
if (! $this->isCrudControllerPath($path)) {
continue;
$contents = $this->context()->readFile($path);
if ($contents === null) {
if ($contentsValidator !== null && $contentsValidator($contents, $path) !== true) {
$filtered[] = $path;
return $filtered;
protected function isCrudControllerPath(string $path): bool
return str_contains($path, 'CrudController');
abstract protected function context(): UpgradeContext;