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 06cfc8c..6ec74f6 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ testbench.yaml vendor composer.phar tests/_output/* +.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' => [