1 | <?php |
||
17 | class SetupHelper |
||
18 | { |
||
19 | /** |
||
20 | * @var StateCollectionInterface |
||
21 | */ |
||
22 | protected $stateCollection; |
||
23 | |||
24 | /** |
||
25 | * @param StateCollectionInterface $stateCollection |
||
26 | */ |
||
27 | 17 | public function __construct(StateCollectionInterface $stateCollection) |
|
31 | |||
32 | /** |
||
33 | * @param string $name |
||
34 | * @return StateInterface |
||
35 | */ |
||
36 | 4 | protected function createNewState($name) |
|
40 | |||
41 | /** |
||
42 | * @param $name |
||
43 | * |
||
44 | * @return \MetaborStd\Statemachine\StateInterface |
||
45 | * |
||
46 | * @throws \Exception |
||
47 | */ |
||
48 | 4 | public function findOrCreateState($name) |
|
60 | |||
61 | /** |
||
62 | * @param StateInterface $sourceState |
||
63 | * @param StateInterface $targetState |
||
64 | * @param string $eventName |
||
65 | * @param ConditionInterface $condition |
||
66 | * |
||
67 | * @return TransitionInterface |
||
68 | */ |
||
69 | 4 | protected function findTransition(StateInterface $sourceState, StateInterface $targetState, $eventName = null, ConditionInterface $condition = null) |
|
82 | |||
83 | /** |
||
84 | * @param StateInterface $sourceState |
||
85 | * @param TransitionInterface $sourceTransition |
||
86 | * |
||
87 | * @throws \InvalidArgumentException |
||
88 | */ |
||
89 | 4 | protected function addTransition(StateInterface $sourceState, TransitionInterface $sourceTransition) |
|
97 | |||
98 | /** |
||
99 | * @param StateInterface $sourceState |
||
100 | * @param StateInterface $targetState |
||
101 | * @param string $eventName |
||
102 | * @param ConditionInterface $condition |
||
103 | * |
||
104 | * @return TransitionInterface |
||
105 | */ |
||
106 | 4 | public function createNewTransition(StateInterface $sourceState, StateInterface $targetState, $eventName = null, ConditionInterface $condition = null) |
|
110 | |||
111 | /** |
||
112 | * @param string $sourceStateName |
||
113 | * @param string $targetStateName |
||
114 | * @param string $eventName |
||
115 | * @param ConditionInterface $condition |
||
116 | * |
||
117 | * @return TransitionInterface |
||
118 | */ |
||
119 | 4 | public function findOrCreateTransition($sourceStateName, $targetStateName, $eventName = null, ConditionInterface $condition = null) |
|
131 | |||
132 | /** |
||
133 | * @param StateInterface $sourceState |
||
134 | * @param string $eventName |
||
135 | * |
||
136 | * @return EventInterface |
||
137 | */ |
||
138 | public function createNewEvent(StateInterface $sourceState, $eventName) |
||
146 | |||
147 | /** |
||
148 | * @param string $sourceStateName |
||
149 | * @param string $eventName |
||
150 | * @return EventInterface |
||
151 | */ |
||
152 | public function findOrCreateEvent($sourceStateName, $eventName) |
||
161 | |||
162 | /** |
||
163 | * If there is no Transition from the SourceState with this Event use addCommandAndSelfTransition(). |
||
164 | * |
||
165 | * @param $sourceStateName |
||
166 | * @param string $eventName |
||
167 | * @param \SplObserver $command |
||
168 | */ |
||
169 | public function addCommand($sourceStateName, $eventName, \SplObserver $command) |
||
173 | |||
174 | /** |
||
175 | * @param $sourceStateName |
||
176 | * @param string $eventName |
||
177 | * @param \SplObserver $command |
||
178 | */ |
||
179 | public function addCommandAndSelfTransition($sourceStateName, $eventName, \SplObserver $command) |
||
184 | } |
||
185 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.