1 | <?php |
||
24 | class FormObjectSteps |
||
25 | { |
||
26 | const METADATA_STEP_PERSISTENCE_KEY = 'core.formStepPersistence'; |
||
27 | |||
28 | /** |
||
29 | * @var FormObject |
||
30 | */ |
||
31 | protected $formObject; |
||
32 | |||
33 | /** |
||
34 | * Step persistence is saved in the form metadata. |
||
35 | * |
||
36 | * It allows having essential information about the form steps whenever it |
||
37 | * is needed: submitted form values, as well as steps that were already |
||
38 | * validated. |
||
39 | * |
||
40 | * @var FormStepPersistence |
||
41 | */ |
||
42 | protected $stepPersistence; |
||
43 | |||
44 | /** |
||
45 | * @var Step |
||
46 | */ |
||
47 | protected $currentStep; |
||
48 | |||
49 | /** |
||
50 | * @var SubstepDefinition |
||
51 | */ |
||
52 | protected $currentSubstepDefinition; |
||
53 | |||
54 | /** |
||
55 | * @var Substep[] |
||
56 | */ |
||
57 | protected $substepsPath; |
||
58 | |||
59 | /** |
||
60 | * @var bool |
||
61 | */ |
||
62 | protected $lastSubstepValidated = false; |
||
63 | |||
64 | /** |
||
65 | * @param FormObject $formObject |
||
66 | */ |
||
67 | public function __construct(FormObject $formObject) |
||
71 | |||
72 | /** |
||
73 | * This function will search among the registered steps to find the one that |
||
74 | * has the same controller parameters. |
||
75 | * |
||
76 | * It is also possible not to find any step, in this case `null` is |
||
77 | * returned. |
||
78 | * |
||
79 | * @todo: memoization with request spl object storage |
||
80 | * |
||
81 | * @param Request $request |
||
82 | */ |
||
83 | public function fetchCurrentStep(Request $request) |
||
124 | |||
125 | /** |
||
126 | * @return Step|null |
||
127 | */ |
||
128 | public function getCurrentStep() |
||
136 | |||
137 | /** |
||
138 | * Fetches the step persistence object for the form, which may have been |
||
139 | * stored in the form metadata. |
||
140 | * |
||
141 | * If the form object hash did change since the persistence object was saved |
||
142 | * it is "refreshed" with the new hash (some data are also deleted as they |
||
143 | * are no longer considered as valid). |
||
144 | * |
||
145 | * @return FormStepPersistence |
||
146 | */ |
||
147 | public function getStepPersistence() |
||
172 | |||
173 | /** |
||
174 | * @return SubstepDefinition|null |
||
175 | */ |
||
176 | public function getCurrentSubstepDefinition() |
||
190 | |||
191 | /** |
||
192 | * @param SubstepDefinition $currentSubstepDefinition |
||
193 | */ |
||
194 | public function setCurrentSubstepDefinition(SubstepDefinition $currentSubstepDefinition) |
||
199 | |||
200 | /** |
||
201 | * @return Substep[] |
||
202 | */ |
||
203 | public function getSubstepsPath() |
||
207 | |||
208 | /** |
||
209 | * @param Substep[] $substepsPath |
||
210 | */ |
||
211 | public function setSubstepsPath(array $substepsPath) |
||
215 | |||
216 | /** |
||
217 | * @param Substep $substep |
||
218 | */ |
||
219 | public function addSubstepToPath(Substep $substep) |
||
223 | |||
224 | /** |
||
225 | * @todo |
||
226 | */ |
||
227 | public function markLastSubstepAsValidated() |
||
231 | |||
232 | /** |
||
233 | * @return bool |
||
234 | */ |
||
235 | public function lastSubstepWasValidated() |
||
239 | } |
||
240 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..