diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5db691bc5..adc36412a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -51,7 +51,7 @@ jobs: - name: install dependencies run: composer install --prefer-dist --no-interaction --no-progress - name: run cs-fixer - run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff + run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --rules=psr_autoloading continue-on-error: true - name: execute unit tests run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit diff --git a/.php_cs.dist b/.php_cs.dist index bd4535683..3eb33508b 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -3,9 +3,9 @@ use PhpCsFixer\Config; use PhpCsFixer\Finder; -$finder = (new Finder)->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage']); +$finder = (new Finder())->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage', 'bootstrap/cache']); -return (new Config) +return (new Config()) ->setRiskyAllowed(true) ->setFinder($finder) ->setRules([ @@ -23,8 +23,6 @@ return (new Config) 'ordered_imports' => [ 'sortAlgorithm' => 'length', ], - 'psr0' => ['dir' => 'app'], - 'psr4' => true, 'random_api_migration' => true, 'ternary_to_null_coalescing' => true, 'yoda_style' => [ diff --git a/app/Http/Controllers/Admin/Settings/IndexController.php b/app/Http/Controllers/Admin/Settings/IndexController.php index 5fb225e9b..190646fd4 100644 --- a/app/Http/Controllers/Admin/Settings/IndexController.php +++ b/app/Http/Controllers/Admin/Settings/IndexController.php @@ -44,8 +44,7 @@ class IndexController extends Controller Kernel $kernel, SettingsRepositoryInterface $settings, SoftwareVersionService $versionService - ) - { + ) { $this->alert = $alert; $this->kernel = $kernel; $this->settings = $settings; diff --git a/composer.json b/composer.json index d8e88ef3f..ab9dd5a0c 100644 --- a/composer.json +++ b/composer.json @@ -68,7 +68,7 @@ } }, "scripts": { - "php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist", + "php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist --rules=psr_autoloading", "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ],