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..920b797 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -1,4 +1,4 @@ -name: Quality (PHPStan level 4) +name: Quality (PHPStan level 5) on: push jobs: cs-fixer: @@ -34,5 +34,5 @@ jobs: uses: php-actions/phpstan@v3 with: path: src/ - level: 4 + level: 5 php_version: '8.2' diff --git a/composer.json b/composer.json index 1f04273..37b91e1 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ }, "extra": { "branch-alias": { - "dev-main": "0.4.x-dev" + "dev-main": "0.5.x-dev" } } } diff --git a/src/ExtractingInterface.php b/src/ExtractingInterface.php index 8f46007..383e8d2 100644 --- a/src/ExtractingInterface.php +++ b/src/ExtractingInterface.php @@ -12,8 +12,9 @@ interface ExtractingInterface * @param ExtractorInterface $extractor */ public function extract( + StepCodeInterface $step, ExtractorInterface $extractor, - RejectionInterface $rejection, - StateInterface $state, + StepRejectionInterface $rejection, + StepStateInterface $state, ): self; } diff --git a/src/LoadingInterface.php b/src/LoadingInterface.php index 3dc720f..073c97b 100644 --- a/src/LoadingInterface.php +++ b/src/LoadingInterface.php @@ -12,8 +12,9 @@ interface LoadingInterface * @param LoaderInterface $loader */ public function load( + StepCodeInterface $step, LoaderInterface $loader, - RejectionInterface $rejection, - StateInterface $state, + StepRejectionInterface $rejection, + StepStateInterface $state, ): self; } diff --git a/src/NullRejection.php b/src/NullRejection.php index bd5b239..111700a 100644 --- a/src/NullRejection.php +++ b/src/NullRejection.php @@ -11,8 +11,14 @@ public function initialize(): void // NOOP } - /** @param non-empty-array|object $rejection */ - public function reject(array|object $rejection, \Throwable $exception = null, string $reason = null): void + /** @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, array|object $rejection, string $reason, \Throwable $exception = null): void { // NOOP } diff --git a/src/NullState.php b/src/NullState.php index 437b6f9..c9b0970 100644 --- a/src/NullState.php +++ b/src/NullState.php @@ -11,17 +11,17 @@ public function initialize(int $start = 0): void // NOOP } - public function accept(int $step = 1): void + public function accept(StepCodeInterface $step, int $count = 1): void { // NOOP } - public function reject(int $step = 1): void + public function reject(StepCodeInterface $step, int $count = 1): void { // NOOP } - public function error(int $step = 1): void + public function error(StepCodeInterface $step, int $count = 1): void { // NOOP } diff --git a/src/PipelineRunnerInterface.php b/src/PipelineRunnerInterface.php index 83618e9..b652778 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 a11fdab..eaa3409 100644 --- a/src/RejectionInterface.php +++ b/src/RejectionInterface.php @@ -8,8 +8,11 @@ interface RejectionInterface { public function initialize(): void; - /** @param non-empty-array|object $rejection */ - public function reject(array|object $rejection, \Throwable $exception = null, string $reason = null): void; + /** @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; } diff --git a/src/RejectionWithReasonInterface.php b/src/RejectionWithReasonInterface.php deleted file mode 100644 index a8aedf7..0000000 --- a/src/RejectionWithReasonInterface.php +++ /dev/null @@ -1,10 +0,0 @@ -|object $rejection */ + public function reject(array|object $rejection, \Throwable $exception = null): void; + + public function rejectWithReason(array|object $rejection, string $reason, \Throwable $exception = null): void; + + public function teardown(): void; +} diff --git a/src/StepStateInterface.php b/src/StepStateInterface.php new file mode 100644 index 0000000..00f42b1 --- /dev/null +++ b/src/StepStateInterface.php @@ -0,0 +1,14 @@ + $transformer */ public function transform( + StepCodeInterface $step, TransformerInterface $transformer, - RejectionInterface $rejection, - StateInterface $state, + StepRejectionInterface $rejection, + StepStateInterface $state, ): self; }