From 4477a3c341d53d9baedf9dcf8844e1966819c2de Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Mon, 29 Apr 2024 14:19:04 +0200 Subject: [PATCH 1/2] PhpCsFixer: Execute on pull requests --- .github/workflows/php-cs-fixer.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yaml b/.github/workflows/php-cs-fixer.yaml index 7fe1f05..6d19d4f 100644 --- a/.github/workflows/php-cs-fixer.yaml +++ b/.github/workflows/php-cs-fixer.yaml @@ -1,11 +1,17 @@ - name: "PHP-CS-Fixer" on: + pull_request_target: + branches: + - "[0-9]+.[0-9]+" + - "[0-9]+.x" + - "feature-*" push: branches: - "[0-9]+.[0-9]+" - "[0-9]+.x" + - "*_actions" + - "feature-*" permissions: contents: read @@ -16,13 +22,14 @@ jobs: contents: write # for stefanzweifel/git-auto-commit-action to push code in repo runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga:latest - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Apply php-cs-fixer changes From edbcf39fb21c3e6da17ce1dd1e35de28902df852 Mon Sep 17 00:00:00 2001 From: Sebastian Blank Date: Mon, 29 Apr 2024 14:41:57 +0200 Subject: [PATCH 2/2] PhpCsFixer: Execute on pull requests --- .php-cs-fixer.dist.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 323d460..a385b84 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -3,6 +3,7 @@ $finder = PhpCsFixer\Finder::create() ->in([ __DIR__ . '/src', + __DIR__ . '/tests', __DIR__ . '/config' ]) @@ -10,9 +11,6 @@ __DIR__ . '/tests/_output', __DIR__ . '/tests/Support/_generated', ]) - - // do not fix views - ->notName('*.html.php') ; // do not enable self_accessor as it breaks pimcore models relying on get_called_class() @@ -21,6 +19,7 @@ '@PSR1' => true, '@PSR2' => true, 'array_syntax' => ['syntax' => 'short'], + 'list_syntax' => ['syntax' => 'short'], 'header_comment' => [ 'comment_type' => 'PHPDoc', @@ -54,6 +53,7 @@ 'no_leading_namespace_whitespace' => true, 'no_short_bool_cast' => true, 'no_spaces_around_offset' => true, + 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], 'no_unneeded_control_parentheses' => true, 'no_unused_imports' => true, 'no_whitespace_before_comma_in_array' => true,