1 | <?php |
||
27 | class ControllerProcessor implements SingletonInterface |
||
28 | { |
||
29 | use ExtendedSelfInstantiateTrait; |
||
30 | |||
31 | /** |
||
32 | * @var FormObjectFactory |
||
33 | */ |
||
34 | protected $formObjectFactory; |
||
35 | |||
36 | /** |
||
37 | * @var FormObject[] |
||
38 | */ |
||
39 | protected $formArguments; |
||
40 | |||
41 | /** |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $dispatched = false; |
||
45 | |||
46 | /** |
||
47 | * @var Request |
||
48 | */ |
||
49 | protected $request; |
||
50 | |||
51 | /** |
||
52 | * @var Request |
||
53 | */ |
||
54 | protected $realRequest; |
||
55 | |||
56 | /** |
||
57 | * @var Request |
||
58 | */ |
||
59 | protected $originalRequest; |
||
60 | |||
61 | /** |
||
62 | * @var Arguments |
||
63 | */ |
||
64 | protected $requestArguments; |
||
65 | |||
66 | /** |
||
67 | * @var array |
||
68 | */ |
||
69 | protected $settings = []; |
||
70 | |||
71 | /** |
||
72 | * Contains information about the last request that was dispatched to FormZ. |
||
73 | * It is used to prevent infinite loop. |
||
74 | * |
||
75 | * @var string |
||
76 | */ |
||
77 | protected $lastDispatchedRequest; |
||
78 | |||
79 | /** |
||
80 | * @param MvcRequest $request |
||
81 | * @param Arguments $requestArguments |
||
82 | * @return $this |
||
83 | */ |
||
84 | public static function prepare(MvcRequest $request, Arguments $requestArguments) |
||
85 | { |
||
86 | return self::get()->setData($request, $requestArguments, []); |
||
87 | } |
||
88 | |||
89 | /** |
||
90 | * Injects the data needed for this class to work properly. This method must |
||
91 | * be called before the `dispatch` method is called. |
||
92 | * |
||
93 | * @param MvcRequest $request |
||
94 | * @param Arguments $requestArguments |
||
95 | * @param array $settings |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function setData(MvcRequest $request, Arguments $requestArguments, array $settings) |
||
117 | |||
118 | /** |
||
119 | * Will dispatch the current request to the form controller, which will take |
||
120 | * care of processing everything properly. |
||
121 | * |
||
122 | * In case no form is found in the controller action parameters, the current |
||
123 | * request is not killed. |
||
124 | * |
||
125 | * @throws StopActionException |
||
126 | */ |
||
127 | public function dispatch() |
||
148 | |||
149 | /** |
||
150 | * Will check if the form objects found in the request arguments contain |
||
151 | * configuration errors. If they do, we dispatch the request to the error |
||
152 | * view, where all errors will be explained properly to the user. |
||
153 | */ |
||
154 | protected function checkFormObjectsErrors() |
||
165 | |||
166 | /** |
||
167 | * Loops on the request arguments, and pick up each one that is a form |
||
168 | * instance (it implements `FormInterface`). |
||
169 | * |
||
170 | * @return FormObject[] |
||
171 | */ |
||
172 | public function getRequestForms() |
||
195 | |||
196 | /** |
||
197 | * @return Request |
||
198 | */ |
||
199 | public function getRequest() |
||
203 | |||
204 | /** |
||
205 | * @return Arguments |
||
206 | */ |
||
207 | public function getRequestArguments() |
||
211 | |||
212 | /** |
||
213 | * @return array |
||
214 | */ |
||
215 | public function getSettings() |
||
219 | |||
220 | /** |
||
221 | * @param FormObjectFactory $formObjectFactory |
||
222 | */ |
||
223 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
227 | } |
||
228 |
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..