Total Complexity | 5 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Coverage | 88.89% |
Changes | 0 |
1 | <?php |
||
9 | final class ManyToOneTransition implements StateTransition |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $name; |
||
15 | |||
16 | /** |
||
17 | * @var string[] |
||
18 | */ |
||
19 | private $fromStates; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $to; |
||
25 | |||
26 | /** |
||
27 | * @param string $name |
||
28 | * @param string[] $fromStates |
||
29 | * @param string $to |
||
30 | */ |
||
31 | 21 | public function __construct($name, array $fromStates, $to) |
|
40 | 21 | } |
|
41 | |||
42 | /** |
||
43 | * @return string |
||
44 | */ |
||
45 | 18 | public function getName() |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * @param RegistryBuilder $registry |
||
52 | */ |
||
53 | 18 | public function onRegister(RegistryBuilder $registry) |
|
54 | { |
||
55 | 18 | foreach ($this->fromStates as $from) { |
|
56 | 18 | $registry->registerStartingState($this->name, $from, []); |
|
57 | } |
||
58 | |||
59 | 18 | $registry->registerDestinationState($this->name, $this->to, []); |
|
60 | 18 | } |
|
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | public function getDestinationState() |
||
68 | } |
||
69 | } |
||
70 |