From 279c3be3f78101d1aed8dd886d7e0a72085a80f5 Mon Sep 17 00:00:00 2001 From: Freek Van der Herten Date: Fri, 12 Jan 2024 16:18:35 +0100 Subject: [PATCH] use pint --- .../workflows/fix-php-code-style-issues.yml | 10 ++--- .php-cs-fixer.dist.php | 39 ------------------- 2 files changed, 4 insertions(+), 45 deletions(-) delete mode 100644 .php-cs-fixer.dist.php diff --git a/.github/workflows/fix-php-code-style-issues.yml b/.github/workflows/fix-php-code-style-issues.yml index 8e61c6471..cd4239c24 100644 --- a/.github/workflows/fix-php-code-style-issues.yml +++ b/.github/workflows/fix-php-code-style-issues.yml @@ -1,4 +1,4 @@ -name: Check & fix styling +name: Fix PHP code style issues on: push: @@ -9,7 +9,7 @@ permissions: contents: write jobs: - php-cs-fixer: + php-code-styling: runs-on: ubuntu-latest timeout-minutes: 5 @@ -19,10 +19,8 @@ jobs: with: ref: ${{ github.head_ref }} - - name: Run PHP CS Fixer - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --config=.php-cs-fixer.dist.php --allow-risky=yes + - name: Fix PHP code style issues + uses: aglipanci/laravel-pint-action@2.3.1 - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v5 diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index 7ee4ffa7c..000000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,39 +0,0 @@ -in([ - __DIR__ . '/src', - __DIR__ . '/tests', - ]) - ->name('*.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -return (new PhpCsFixer\Config()) - ->setRules([ - '@PSR12' => true, - 'array_syntax' => ['syntax' => 'short'], - 'ordered_imports' => ['sort_algorithm' => 'alpha'], - 'no_unused_imports' => true, - 'not_operator_with_successor_space' => true, - 'trailing_comma_in_multiline' => true, - 'phpdoc_scalar' => true, - 'unary_operator_spaces' => true, - 'binary_operator_spaces' => true, - 'blank_line_before_statement' => [ - 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], - ], - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_var_without_name' => true, - 'class_attributes_separation' => [ - 'elements' => [ - 'method' => 'one', - ], - ], - 'method_argument_space' => [ - 'on_multiline' => 'ensure_fully_multiline', - 'keep_multiple_spaces_after_comma' => true, - ], - 'single_trait_insert_per_statement' => true, - ]) - ->setFinder($finder);