Total Complexity | 4 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
8 | final class CallContextMethodOnFailure implements TransitionCallback |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $to; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $method; |
||
19 | |||
20 | /** |
||
21 | * @var mixed[] |
||
22 | */ |
||
23 | private $args; |
||
24 | |||
25 | /** |
||
26 | * @param string $to |
||
27 | * @param string $method |
||
28 | * @param mixed[] $args |
||
29 | */ |
||
30 | 1 | public function __construct( |
|
31 | string $to, |
||
32 | string $method, |
||
33 | array $args |
||
34 | ) { |
||
35 | 1 | $this->to = $to; |
|
36 | 1 | $this->method = $method; |
|
37 | 1 | $this->args = $args; |
|
38 | 1 | } |
|
39 | |||
40 | /** |
||
41 | * @param mixed $context |
||
42 | * @param StateMachine $machine |
||
43 | */ |
||
44 | 1 | public function beforeStateChange($context, StateMachine $machine): void |
|
45 | { |
||
46 | 1 | } |
|
47 | |||
48 | /** |
||
49 | * @param mixed $context |
||
50 | * @param StateMachine $machine |
||
51 | */ |
||
52 | 1 | public function afterStateChange($context, StateMachine $machine): void |
|
54 | 1 | } |
|
55 | |||
56 | /** |
||
57 | * @param InvalidStateTransitionException $exception |
||
58 | * @param mixed|object $context |
||
59 | * @param StateMachine $machine |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 1 | public function onFailure(InvalidStateTransitionException $exception, $context, StateMachine $machine): string |
|
73 |