1 | <?php |
||
18 | class StateCollectionMerger implements MergeableInterface |
||
19 | { |
||
20 | /** |
||
21 | * @var StateCollectionInterface |
||
22 | */ |
||
23 | private $targetCollection; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $stateNamePrefix; |
||
29 | |||
30 | /** |
||
31 | * @param StateCollectionInterface $targetCollection |
||
32 | 4 | */ |
|
33 | public function __construct(StateCollectionInterface $targetCollection) |
||
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getStateNamePrefix() |
||
45 | |||
46 | /** |
||
47 | * @param string $stateNamePrefix |
||
48 | */ |
||
49 | public function setStateNamePrefix($stateNamePrefix) |
||
53 | |||
54 | /** |
||
55 | * @return \MetaborStd\Statemachine\StateCollectionInterface |
||
56 | */ |
||
57 | public function getTargetCollection() |
||
61 | |||
62 | /** |
||
63 | * @param string $name |
||
64 | * |
||
65 | * @return \MetaborStd\Statemachine\StateInterface |
||
66 | 4 | */ |
|
67 | protected function createState($name) |
||
71 | |||
72 | /** |
||
73 | * @param StateInterface $sourceState |
||
74 | * @param TransitionInterface $sourceTransition |
||
75 | * |
||
76 | * @throws \InvalidArgumentException |
||
77 | 4 | */ |
|
78 | protected function addTransition(StateInterface $sourceState, TransitionInterface $sourceTransition) |
||
86 | |||
87 | /** |
||
88 | * @param TransitionInterface $sourceTransition |
||
89 | * |
||
90 | * @throws \InvalidArgumentException |
||
91 | * |
||
92 | * @return \Metabor\Statemachine\Transition |
||
93 | 4 | */ |
|
94 | protected function createTransition(TransitionInterface $sourceTransition) |
||
117 | |||
118 | /** |
||
119 | 4 | * @param object $source |
|
120 | * @param object $target |
||
121 | 4 | * |
|
122 | 4 | * @throws \RuntimeException |
|
123 | 4 | */ |
|
124 | 4 | protected function mergeMetadata($source, $target) |
|
141 | |||
142 | 4 | /** |
|
143 | * @param StateInterface $state |
||
144 | 4 | * |
|
145 | 4 | * @throws \InvalidArgumentException |
|
146 | 4 | */ |
|
147 | protected function addState(StateInterface $state) |
||
155 | |||
156 | 4 | /** |
|
157 | * @param string $name |
||
158 | 4 | * |
|
159 | 4 | * @return \MetaborStd\Statemachine\StateInterface |
|
160 | 4 | */ |
|
161 | 4 | protected function findOrCreateState($name) |
|
173 | |||
174 | 4 | /** |
|
175 | * @param StateInterface $sourceState |
||
176 | 4 | * |
|
177 | 4 | * @throws \InvalidArgumentException |
|
178 | 4 | */ |
|
179 | protected function mergeState(StateInterface $sourceState) |
||
202 | |||
203 | 4 | /** |
|
204 | 4 | */ |
|
205 | 4 | protected function mergeStateCollection(StateCollectionInterface $source) |
|
212 | |||
213 | 4 | /** |
|
214 | 4 | * @see \MetaborStd\MergeableInterface::merge() |
|
215 | 4 | */ |
|
216 | public function merge($source) |
||
230 | } |
||
231 |
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.
The variable may have been renamed without also renaming all references.