1 | <?php |
||
28 | class ControllerProcessor implements SingletonInterface |
||
29 | { |
||
30 | use ExtendedSelfInstantiateTrait; |
||
31 | |||
32 | /** |
||
33 | * @var FormObjectFactory |
||
34 | */ |
||
35 | protected $formObjectFactory; |
||
36 | |||
37 | /** |
||
38 | * @var FormObject[] |
||
39 | */ |
||
40 | protected $formArguments; |
||
41 | |||
42 | /** |
||
43 | * @var bool |
||
44 | */ |
||
45 | protected $dispatched = false; |
||
46 | |||
47 | /** |
||
48 | * @var Request |
||
49 | */ |
||
50 | protected $originalRequest; |
||
51 | |||
52 | /** |
||
53 | * @var Request |
||
54 | */ |
||
55 | protected $request; |
||
56 | |||
57 | /** |
||
58 | * @var Arguments |
||
59 | */ |
||
60 | protected $requestArguments; |
||
61 | |||
62 | /** |
||
63 | * An interface name that does implement: |
||
64 | * |
||
65 | * @see \Romm\Formz\Middleware\Scope\ScopeInterface |
||
66 | * |
||
67 | * It will be used to filter the middlewares that will be called. |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | protected $scope; |
||
72 | |||
73 | /** |
||
74 | * @var array |
||
75 | */ |
||
76 | protected $settings = []; |
||
77 | |||
78 | /** |
||
79 | * @todo |
||
80 | * |
||
81 | * @var string |
||
82 | */ |
||
83 | protected $lastDispatchedRequest; |
||
84 | |||
85 | /** |
||
86 | * @var callable |
||
87 | */ |
||
88 | protected $exceptionCallback; |
||
89 | |||
90 | /** |
||
91 | * @param MvcRequest $request |
||
92 | * @param Arguments $requestArguments |
||
93 | * @param array $settings |
||
94 | * @param string $scope |
||
95 | * @return $this |
||
96 | */ |
||
97 | public static function prepare(MvcRequest $request, Arguments $requestArguments, $scope, array $settings = []) |
||
98 | { |
||
99 | return self::get()->setData($request, $requestArguments, $scope, $settings); |
||
100 | } |
||
101 | |||
102 | /** |
||
103 | * Injects the data needed for this class to work properly. This method must |
||
104 | * be called before the dispatch is called. |
||
105 | * |
||
106 | * @param MvcRequest $request |
||
107 | * @param Arguments $requestArguments |
||
108 | * @param string $scope |
||
109 | * @param array $settings |
||
110 | * @return $this |
||
111 | */ |
||
112 | public function setData(MvcRequest $request, Arguments $requestArguments, $scope, array $settings = []) |
||
135 | |||
136 | /** |
||
137 | * Will dispatch the current request to the form controller, which will take |
||
138 | * care of processing everything properly. |
||
139 | * |
||
140 | * In case no form is found in the controller action parameters, the current |
||
141 | * request is not killed. |
||
142 | * |
||
143 | * @throws StopActionException |
||
144 | */ |
||
145 | public function dispatch() |
||
153 | |||
154 | /** |
||
155 | * Wrapper for unit testing. |
||
156 | */ |
||
157 | protected function doDispatch() |
||
171 | |||
172 | /** |
||
173 | * Will check if the form objects found in the request arguments contain |
||
174 | * configuration errors. If they do, we dispatch the request to the error |
||
175 | * view, where all errors will be explained properly to the user. |
||
176 | */ |
||
177 | protected function checkFormObjectsErrors() |
||
188 | |||
189 | /** |
||
190 | * Loops on the request arguments, and pick up each one that is a form |
||
191 | * instance (it implements `FormInterface`). |
||
192 | * |
||
193 | * @return FormObject[] |
||
194 | */ |
||
195 | public function getRequestForms() |
||
224 | |||
225 | /** |
||
226 | * @return Request |
||
227 | */ |
||
228 | public function getRequest() |
||
232 | |||
233 | /** |
||
234 | * @return Arguments |
||
235 | */ |
||
236 | public function getRequestArguments() |
||
240 | |||
241 | /** |
||
242 | * @return array |
||
243 | */ |
||
244 | public function getSettings() |
||
248 | |||
249 | /** |
||
250 | * @return string |
||
251 | */ |
||
252 | public function getScope() |
||
256 | |||
257 | /** |
||
258 | * @param callable $callback |
||
259 | * @return $this |
||
260 | */ |
||
261 | public function setExceptionCallback(callable $callback) |
||
267 | |||
268 | /** |
||
269 | * @return callable |
||
270 | */ |
||
271 | public function getExceptionCallback() |
||
275 | |||
276 | /** |
||
277 | * @return bool |
||
278 | */ |
||
279 | public function hasExceptionCallback() |
||
283 | |||
284 | /** |
||
285 | * @param FormObjectFactory $formObjectFactory |
||
286 | */ |
||
287 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
291 | } |
||
292 |
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..