Total Complexity | 5 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 86.67% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
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 | 20 | public function __construct(string $name, string $to, string ...$fromStates) |
|
32 | 20 | } |
|
33 | |||
34 | 18 | public function getName(): string |
|
37 | } |
||
38 | |||
39 | 18 | public function onRegister(RegistryBuilder $registry): void |
|
40 | { |
||
41 | 18 | foreach ($this->fromStates as $from) { |
|
42 | 18 | $registry->registerStartingState($this->name, $from, []); |
|
43 | } |
||
44 | |||
45 | 18 | $registry->registerDestinationState($this->name, $this->to, []); |
|
46 | 18 | } |
|
47 | |||
48 | public function getDestinationState(): string |
||
51 | } |
||
52 | } |
||
53 |