From 183088b3060a956e253d7be923219cceec18419c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Planchat?= Date: Wed, 15 Nov 2023 11:46:21 +0100 Subject: [PATCH] Updated to PHPStan level 9 --- .github/workflows/phpstan-5.yaml | 23 ----------------------- .github/workflows/phpstan-7.yaml | 23 ----------------------- .github/workflows/phpstan-8.yaml | 23 ----------------------- .github/workflows/quality.yaml | 28 +++++++++++++++++++++++++++- README.md | 5 +---- phpstan.neon | 3 +++ 6 files changed, 31 insertions(+), 74 deletions(-) delete mode 100644 .github/workflows/phpstan-5.yaml delete mode 100644 .github/workflows/phpstan-7.yaml delete mode 100644 .github/workflows/phpstan-8.yaml create mode 100644 phpstan.neon diff --git a/.github/workflows/phpstan-5.yaml b/.github/workflows/phpstan-5.yaml deleted file mode 100644 index 3b32501..0000000 --- a/.github/workflows/phpstan-5.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: PHPStan level 5 -on: push -jobs: - phpstan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: '**/vendor' - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - uses: php-actions/composer@v6 - with: - args: --prefer-dist - php_version: 8.2 - - name: PHPStan - uses: php-actions/phpstan@v3 - with: - path: src/ - level: 4 - php_version: 8.2 diff --git a/.github/workflows/phpstan-7.yaml b/.github/workflows/phpstan-7.yaml deleted file mode 100644 index 3024b14..0000000 --- a/.github/workflows/phpstan-7.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: PHPStan level 7 -on: push -jobs: - phpstan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: '**/vendor' - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - uses: php-actions/composer@v6 - with: - args: --prefer-dist - php_version: 8.2 - - name: PHPStan - uses: php-actions/phpstan@v2 - with: - path: src/ - level: 7 - php_version: 8.2 diff --git a/.github/workflows/phpstan-8.yaml b/.github/workflows/phpstan-8.yaml deleted file mode 100644 index f2386ee..0000000 --- a/.github/workflows/phpstan-8.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: PHPStan level 8 -on: push -jobs: - phpstan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: '**/vendor' - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - uses: php-actions/composer@v6 - with: - args: --prefer-dist - php_version: 8.2 - - name: PHPStan - uses: php-actions/phpstan@v3 - with: - path: src/ - level: 8 - php_version: 8.2 diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index 9ba0507..c138524 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -1,12 +1,38 @@ -name: Quality +name: Quality (PHPStan level 9) on: push jobs: cs-fixer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: composer:v2 + coverage: none - name: Cs-Fixer run: | wget -q https://cs.symfony.com/download/php-cs-fixer-v3.phar -O php-cs-fixer chmod a+x php-cs-fixer PHP_CS_FIXER_IGNORE_ENV=true ./php-cs-fixer fix src --dry-run + + phpstan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: '**/vendor' + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + - uses: php-actions/composer@v6 + with: + args: --prefer-dist + php_version: '8.2' + - name: PHPStan + uses: php-actions/phpstan@v3 + with: + path: src/ + level: 9 + php_version: '8.2' diff --git a/README.md b/README.md index 5c79c30..4650923 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,7 @@ Action contracts This package brings interfaces for the action component with logging, line rejections and execution states. -[![Quality](https://github.com/php-etl/action-contracts/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/pipeline-contracts/actions/workflows/quality.yaml) -[![PHPStan level 5](https://github.com/php-etl/action-contracts/actions/workflows/phpstan-5.yaml/badge.svg)](https://github.com/php-etl/pipeline-contracts/actions/workflows/phpstan-5.yaml) -[![PHPStan level 7](https://github.com/php-etl/action-contracts/actions/workflows/phpstan-7.yaml/badge.svg)](https://github.com/php-etl/pipeline-contracts/actions/workflows/phpstan-7.yaml) -[![PHPStan level 8](https://github.com/php-etl/action-contracts/actions/workflows/phpstan-8.yaml/badge.svg)](https://github.com/php-etl/pipeline-contracts/actions/workflows/phpstan-8.yaml) +[![Quality (PHPStan level 9)](https://github.com/php-etl/action-contracts/actions/workflows/quality.yaml/badge.svg)](https://github.com/php-etl/pipeline-contracts/actions/workflows/quality.yaml) ![PHP](https://img.shields.io/packagist/php-v/php-etl/action-contracts) Documentation diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..3ed9974 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,3 @@ +parameters: + excludePaths: + - src/ActionState.php