1 | <?php |
||
27 | class FormController extends ActionController |
||
28 | { |
||
29 | /** |
||
30 | * @var FormObject[] |
||
31 | */ |
||
32 | protected $formArguments = []; |
||
33 | |||
34 | /** |
||
35 | * @var FormzControllerContext |
||
36 | */ |
||
37 | protected $formzControllerContext; |
||
38 | |||
39 | /** |
||
40 | * @var HashService |
||
41 | */ |
||
42 | protected $hashService; |
||
43 | |||
44 | /** |
||
45 | * @var FormObjectFactory |
||
46 | */ |
||
47 | protected $formObjectFactory; |
||
48 | |||
49 | /** |
||
50 | * Main action used to dispatch the request properly, depending on FormZ |
||
51 | * configuration. |
||
52 | * |
||
53 | * The request is based on the previously called controller action, and is |
||
54 | * used to list which forms are handled (every argument of the action method |
||
55 | * that implements the interface `FormInterface`). |
||
56 | * |
||
57 | * Middlewares will be called for each form argument, and may modify the |
||
58 | * request, which is then dispatched again with modified data. |
||
59 | */ |
||
60 | public function processFormAction() |
||
95 | |||
96 | /** |
||
97 | * Will fetch every form argument for this request, and dispatch every |
||
98 | * middleware that was registered in its TypoScript configuration. |
||
99 | */ |
||
100 | protected function invokeMiddlewares() |
||
118 | |||
119 | /** |
||
120 | * Will check if the request result contains error; if errors are found, the |
||
121 | * request is forwarded to the referring request, with the arguments of the |
||
122 | * current request. |
||
123 | */ |
||
124 | protected function manageRequestResult() |
||
140 | |||
141 | /** |
||
142 | * Loops on the request arguments, and pick up each one that is a form |
||
143 | * instance (it implements `FormInterface`). |
||
144 | * |
||
145 | * @return FormObject[] |
||
146 | */ |
||
147 | protected function getRequestForms() |
||
168 | |||
169 | /** |
||
170 | * @todo |
||
171 | * |
||
172 | * @return array |
||
173 | */ |
||
174 | protected function getRequestData() |
||
186 | |||
187 | /** |
||
188 | * @param FormzControllerContext $formzControllerContext |
||
189 | */ |
||
190 | public function injectFormzControllerContext(FormzControllerContext $formzControllerContext) |
||
194 | |||
195 | /** |
||
196 | * @param HashService $hashService |
||
197 | */ |
||
198 | public function injectHashService(HashService $hashService) |
||
202 | |||
203 | /** |
||
204 | * @param FormObjectFactory $formObjectFactory |
||
205 | */ |
||
206 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
210 | } |
||
211 |
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: