diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 4cf285f..f55d1fa 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -15,7 +15,7 @@ jobs: - name: Run PHP CS Fixer uses: docker://oskarstark/php-cs-fixer-ga with: - args: --config=.php_cs.dist --allow-risky=yes + args: --config=.php_cs.dist.php --allow-risky=yes - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/.gitignore b/.gitignore index 0296b57..adc6804 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ docs phpunit.xml psalm.xml vendor +.php-cs-fixer.cache diff --git a/.php_cs.dist b/.php_cs.dist.php similarity index 78% rename from .php_cs.dist rename to .php_cs.dist.php index c7d380c..8d8a790 100644 --- a/.php_cs.dist +++ b/.php_cs.dist.php @@ -1,9 +1,6 @@ notPath('bootstrap/*') - ->notPath('storage/*') - ->notPath('resources/view/mail/*') ->in([ __DIR__ . '/src', __DIR__ . '/tests', @@ -13,14 +10,14 @@ ->ignoreDotFiles(true) ->ignoreVCS(true); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRules([ - '@PSR2' => true, + '@PSR12' => true, 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sortAlgorithm' => 'alpha'], + 'ordered_imports' => ['sort_algorithm' => 'alpha'], 'no_unused_imports' => true, 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => true, 'phpdoc_scalar' => true, 'unary_operator_spaces' => true, 'binary_operator_spaces' => true, @@ -31,7 +28,7 @@ 'phpdoc_var_without_name' => true, 'class_attributes_separation' => [ 'elements' => [ - 'method', + 'method' => 'one', ], ], 'method_argument_space' => [ diff --git a/composer.json b/composer.json index e6970be..0770c70 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "spatie/ssh": "^1.5" }, "require-dev": { - "orchestra/testbench": "^6.23|^7.,", + "orchestra/testbench": "^6.23|^7.0", "phpunit/phpunit": "^9.4", "spatie/laravel-ray": "^1.9", "spatie/ray": "^1.21",