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 $originalRequest; |
||
50 | |||
51 | /** |
||
52 | * @var Request |
||
53 | */ |
||
54 | protected $request; |
||
55 | |||
56 | /** |
||
57 | * @var Arguments |
||
58 | */ |
||
59 | protected $requestArguments; |
||
60 | |||
61 | /** |
||
62 | * @var array |
||
63 | */ |
||
64 | protected $settings = []; |
||
65 | |||
66 | /** |
||
67 | * @todo |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | protected $lastDispatchedRequest; |
||
72 | |||
73 | /** |
||
74 | * @var callable |
||
75 | */ |
||
76 | protected $exceptionCallback; |
||
77 | |||
78 | /** |
||
79 | * @param MvcRequest $request |
||
80 | * @param Arguments $requestArguments |
||
81 | * @param array $settings |
||
82 | * @return $this |
||
83 | */ |
||
84 | public static function prepare(MvcRequest $request, Arguments $requestArguments, array $settings) |
||
88 | |||
89 | /** |
||
90 | * Injects the data needed for this class to work properly. This method must |
||
91 | * be called before the dispatch 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) |
||
116 | |||
117 | /** |
||
118 | * Will dispatch the current request to the form controller, which will take |
||
119 | * care of processing everything properly. |
||
120 | * |
||
121 | * In case no form is found in the controller action parameters, the current |
||
122 | * request is not killed. |
||
123 | * |
||
124 | * @throws StopActionException |
||
125 | */ |
||
126 | public function dispatch() |
||
134 | |||
135 | /** |
||
136 | * Wrapper for unit testing. |
||
137 | */ |
||
138 | protected function doDispatch() |
||
152 | |||
153 | /** |
||
154 | * Will check if the form objects found in the request arguments contain |
||
155 | * configuration errors. If they do, we dispatch the request to the error |
||
156 | * view, where all errors will be explained properly to the user. |
||
157 | */ |
||
158 | protected function checkFormObjectsErrors() |
||
169 | |||
170 | /** |
||
171 | * Loops on the request arguments, and pick up each one that is a form |
||
172 | * instance (it implements `FormInterface`). |
||
173 | * |
||
174 | * @return FormObject[] |
||
175 | */ |
||
176 | public function getRequestForms() |
||
199 | |||
200 | /** |
||
201 | * @return Request |
||
202 | */ |
||
203 | public function getRequest() |
||
207 | |||
208 | /** |
||
209 | * @return Arguments |
||
210 | */ |
||
211 | public function getRequestArguments() |
||
215 | |||
216 | /** |
||
217 | * @return array |
||
218 | */ |
||
219 | public function getSettings() |
||
223 | |||
224 | /** |
||
225 | * @param callable $callback |
||
226 | * @return $this |
||
227 | */ |
||
228 | public function setExceptionCallback(callable $callback) |
||
234 | |||
235 | /** |
||
236 | * @return callable |
||
237 | */ |
||
238 | public function getExceptionCallback() |
||
242 | |||
243 | /** |
||
244 | * @return bool |
||
245 | */ |
||
246 | public function hasExceptionCallback() |
||
250 | |||
251 | /** |
||
252 | * @param FormObjectFactory $formObjectFactory |
||
253 | */ |
||
254 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
258 | } |
||
259 |
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..