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..b2d5ab7 100644 --- a/src/NullRejection.php +++ b/src/NullRejection.php @@ -12,7 +12,7 @@ public function initialize(): void } /** @param non-empty-array|object $rejection */ - public function reject(array|object $rejection, \Throwable $exception = null, string $reason = null): void + public function reject(StepCodeInterface $step, array|object $rejection, \Throwable $exception = null, string $reason = 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/RejectionInterface.php b/src/RejectionInterface.php index a11fdab..3dd1dda 100644 --- a/src/RejectionInterface.php +++ b/src/RejectionInterface.php @@ -9,7 +9,8 @@ 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; + public function reject(StepCodeInterface $step, array|object $rejection, \Throwable $exception = null): void; + public function rejectWithReason(StepCodeInterface $step, object|array $rejection, string $reason, null|\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(object|array $rejection, string $reason, null|\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; }