From ca490365ac1e7b33b82db602d6a2d081aafbfa85 Mon Sep 17 00:00:00 2001 From: Nicolas DOUSSON Date: Fri, 22 Dec 2023 15:31:13 +0100 Subject: [PATCH] Add lint on code --- .github/workflows/ci.yml | 19 ++++++++----------- composer.json | 4 ++-- .../Middleware/RetryLockTimeoutMiddleware.php | 2 +- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ba456b..2a6639c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ name: CI -on: [ pull_request, push ] +on: + pull_request: + push: env: COMPOSER_UPDATE_FLAGS: "--no-interaction --no-progress --prefer-dist " @@ -29,20 +31,15 @@ jobs: - name: Composer dependencies run: COMPOSER_UPDATE_FLAGS+="${{matrix.composer_update_flags}}" make vendor + - name: Lint + run: find . -name '*.php' -path './src/*' | parallel -j 4 php -l {} + - name: PHPUnit run: make phpunit static-analysis: runs-on: ubuntu-latest name: Static analysis - strategy: - fail-fast: false - matrix: - include: - - php: 8.1 - composer_update_flags: --prefer-lowest - - php: 8.1 - - php: 8.2 steps: - uses: actions/checkout@v2 @@ -50,10 +47,10 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: "${{ matrix.php }}" + php-version: "8.2" - name: Composer dependencies - run: COMPOSER_UPDATE_FLAGS+="${{matrix.composer_update_flags}}" make vendor + run: make vendor - name: Composer validate run: make composer-validate diff --git a/composer.json b/composer.json index bd3ad17..557fc4c 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,8 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.9", - "phpstan/phpstan": "1.8.2", - "phpstan/phpstan-phpunit": "1.1.1", + "phpstan/phpstan": "1.10.50", + "phpstan/phpstan-phpunit": "1.3.15", "phpunit/phpunit": "^10.4.2", "symfony/var-dumper": ">=6.3.8" } diff --git a/src/Doctrine/DBAL/Driver/Middleware/RetryLockTimeoutMiddleware.php b/src/Doctrine/DBAL/Driver/Middleware/RetryLockTimeoutMiddleware.php index a431a83..338ccbe 100644 --- a/src/Doctrine/DBAL/Driver/Middleware/RetryLockTimeoutMiddleware.php +++ b/src/Doctrine/DBAL/Driver/Middleware/RetryLockTimeoutMiddleware.php @@ -8,7 +8,7 @@ use Doctrine\DBAL\Driver\Middleware; use Psr\Log\LoggerInterface; -final readonly class RetryLockTimeoutMiddleware implements Middleware +final class RetryLockTimeoutMiddleware implements Middleware { public function __construct( private LoggerInterface $logger,