From 803cdee4f3efe774bc658856d21d49f54624dd6e Mon Sep 17 00:00:00 2001 From: Adrien Crivelli Date: Tue, 29 Nov 2022 10:47:35 +0100 Subject: [PATCH] Use local install of friendsofphp/php-cs-fixer Otherwise, `composer check` and `composer fix` are broken and contributing becomes much harder than it should be. Also using the same version everywhere is a benefit to get consistent result locally and on CI. --- .github/workflows/ci.yml | 9 +++------ composer.json | 3 ++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e50faea0..a822bd93 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,14 +79,11 @@ jobs: key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - - name: Composer Install - run: composer global require friendsofphp/php-cs-fixer - - - name: Add environment path - run: export PATH="$PATH:$HOME/.composer/vendor/bin" + - name: Install dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader - name: Code style with PHP-CS-Fixer - run: php-cs-fixer fix --dry-run --diff + run: ./vendor/bin/php-cs-fixer fix --dry-run --diff coverage: runs-on: ubuntu-latest diff --git a/composer.json b/composer.json index ccb42cca..32d2711a 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,8 @@ "phpmd/phpmd": "^2.13", "phpunit/phpunit": ">=7.0", "tecnickcom/tcpdf": "^6.5", - "symfony/process": "^4.4" + "symfony/process": "^4.4", + "friendsofphp/php-cs-fixer": "^3.3" }, "suggest": { "ext-zip": "Allows writing OOXML and ODF",