| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 8 | final class AlwaysReturnStateOnFailure implements TransitionCallback |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private $to; |
||
| 14 | |||
| 15 | public function __construct(string $to) |
||
| 16 | { |
||
| 17 | $this->to = $to; |
||
| 18 | } |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param mixed $context |
||
| 22 | * @param StateMachine $machine |
||
| 23 | */ |
||
| 24 | public function beforeStateChange($context, StateMachine $machine): void |
||
| 25 | { |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param mixed $context |
||
| 30 | * @param StateMachine $machine |
||
| 31 | */ |
||
| 32 | public function afterStateChange($context, StateMachine $machine): void |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param InvalidStateTransitionException $exception |
||
| 38 | * @param mixed $context |
||
| 39 | * @param StateMachine $machine |
||
| 40 | * |
||
| 41 | * @return string |
||
| 42 | */ |
||
| 43 | public function onFailure(InvalidStateTransitionException $exception, $context, StateMachine $machine): string |
||
| 48 |