1 | <?php |
||
28 | class FormController extends ActionController |
||
29 | { |
||
30 | /** |
||
31 | * @var FormObject[] |
||
32 | */ |
||
33 | protected $formArguments = []; |
||
34 | |||
35 | /** |
||
36 | * @var ControllerState |
||
37 | */ |
||
38 | protected $state; |
||
39 | |||
40 | /** |
||
41 | * @var HashService |
||
42 | */ |
||
43 | protected $hashService; |
||
44 | |||
45 | /** |
||
46 | * @var FormObjectFactory |
||
47 | */ |
||
48 | protected $formObjectFactory; |
||
49 | |||
50 | /** |
||
51 | * Main action used to dispatch the request properly, depending on FormZ |
||
52 | * configuration. |
||
53 | * |
||
54 | * The request is based on the previously called controller action, and is |
||
55 | * used to list which forms are handled (every argument of the action method |
||
56 | * that implements the interface `FormInterface`). |
||
57 | * |
||
58 | * Middlewares will be called for each form argument, and may modify the |
||
59 | * request, which is then dispatched again with modified data. |
||
60 | */ |
||
61 | public function processFormAction() |
||
92 | |||
93 | /** |
||
94 | * @param FormObject $formObject |
||
95 | */ |
||
96 | public function formObjectErrorAction(FormObject $formObject) |
||
100 | |||
101 | /** |
||
102 | * Will fetch every form argument for this request, and dispatch every |
||
103 | * middleware that was registered in its TypoScript configuration. |
||
104 | */ |
||
105 | protected function invokeMiddlewares() |
||
130 | |||
131 | /** |
||
132 | * Will check if the request result contains error; if errors are found, the |
||
133 | * request is forwarded to the referring request, with the arguments of the |
||
134 | * current request. |
||
135 | */ |
||
136 | protected function manageRequestResult() |
||
146 | |||
147 | /** |
||
148 | * Forwards the request to the referrer request. It will also fill the |
||
149 | * arguments of the action with the one from the source request. |
||
150 | */ |
||
151 | protected function forwardToReferrer() |
||
162 | |||
163 | /** |
||
164 | * Loops on the request arguments, and pick up each one that is a form |
||
165 | * instance (it implements `FormInterface`). |
||
166 | * |
||
167 | * @return FormObject[] |
||
168 | */ |
||
169 | protected function getRequestForms() |
||
190 | |||
191 | /** |
||
192 | * @todo |
||
193 | * |
||
194 | * @return array |
||
195 | */ |
||
196 | protected function getRequestData() |
||
208 | |||
209 | /** |
||
210 | * @param RedirectException $redirectException |
||
211 | */ |
||
212 | protected function redirectFromException(RedirectException $redirectException) |
||
224 | |||
225 | /** |
||
226 | * @param ControllerState $state |
||
227 | */ |
||
228 | public function injectState(ControllerState $state) |
||
232 | |||
233 | /** |
||
234 | * @param HashService $hashService |
||
235 | */ |
||
236 | public function injectHashService(HashService $hashService) |
||
240 | |||
241 | /** |
||
242 | * @param FormObjectFactory $formObjectFactory |
||
243 | */ |
||
244 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
248 | } |
||
249 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: