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