From b9264b88ca913a31433dcf478e62ba4d007e0ffa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Planchat?= Date: Mon, 13 Nov 2023 12:36:18 +0100 Subject: [PATCH] Fixed PHPStan issues, upgraded to level 5 --- .github/workflows/phpstan-5.yaml | 24 ------------------------ .github/workflows/quality.yaml | 2 +- src/NullRejection.php | 3 ++- src/PipelineRunnerInterface.php | 2 +- src/RejectionInterface.php | 3 ++- 5 files changed, 6 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/phpstan-5.yaml diff --git a/.github/workflows/phpstan-5.yaml b/.github/workflows/phpstan-5.yaml deleted file mode 100644 index 2488785..0000000 --- a/.github/workflows/phpstan-5.yaml +++ /dev/null @@ -1,24 +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: 5 - php_version: '8.2' diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index c1791da..89bf98b 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -34,5 +34,5 @@ jobs: uses: php-actions/phpstan@v3 with: path: src/ - level: 4 + level: 5 php_version: '8.2' diff --git a/src/NullRejection.php b/src/NullRejection.php index ee503f9..670956f 100644 --- a/src/NullRejection.php +++ b/src/NullRejection.php @@ -11,12 +11,13 @@ public function initialize(): void // NOOP } - /** @param non-empty-array|object $rejection */ + /** @param non-empty-array|object $rejection */ public function reject(StepCodeInterface $step, array|object $rejection, \Throwable $exception = null, string $reason = null): void { // NOOP } + /** @param non-empty-array|object $rejection */ public function rejectWithReason(StepCodeInterface $step, object|array $rejection, string $reason, \Throwable $exception = null): void { // NOOP diff --git a/src/PipelineRunnerInterface.php b/src/PipelineRunnerInterface.php index 83618e9..24b737f 100644 --- a/src/PipelineRunnerInterface.php +++ b/src/PipelineRunnerInterface.php @@ -12,7 +12,7 @@ interface PipelineRunnerInterface { /** - * @param \Iterator $source + * @param \Iterator $source * @param \Generator, void> $async * * @return \Iterator diff --git a/src/RejectionInterface.php b/src/RejectionInterface.php index 4d6b4cd..eaa3409 100644 --- a/src/RejectionInterface.php +++ b/src/RejectionInterface.php @@ -8,9 +8,10 @@ interface RejectionInterface { public function initialize(): void; - /** @param non-empty-array|object $rejection */ + /** @param non-empty-array|object $rejection */ public function reject(StepCodeInterface $step, array|object $rejection, \Throwable $exception = null): void; + /** @param non-empty-array|object $rejection */ public function rejectWithReason(StepCodeInterface $step, array|object $rejection, string $reason, \Throwable $exception = null): void; public function teardown(): void;