1 | <?php |
||
31 | class ApiController extends Controller |
||
32 | { |
||
33 | /** |
||
34 | * Get a value from a key. |
||
35 | * |
||
36 | * @param Request $request |
||
37 | * @param string $key |
||
38 | * |
||
39 | * @throw Webmozart\KeyValueStore\Api\NoSuchKeyException |
||
40 | * |
||
41 | * @return KeyValue |
||
42 | */ |
||
43 | public function getAction(Request $request, $key) |
||
55 | |||
56 | /** |
||
57 | * Create a key value. |
||
58 | * |
||
59 | * @param Request $request |
||
60 | * |
||
61 | * @return mixed|FormInterface |
||
62 | */ |
||
63 | public function createAction(Request $request) |
||
70 | |||
71 | /** |
||
72 | * Create a key. |
||
73 | * |
||
74 | * @param Request $request |
||
75 | * @param string $key |
||
76 | * |
||
77 | * @return Response |
||
78 | */ |
||
79 | public function updateAction(Request $request, $key) |
||
90 | |||
91 | /** |
||
92 | * Delete a key. |
||
93 | * |
||
94 | * @param Request $request |
||
95 | * @param string $key |
||
96 | * |
||
97 | * @throw Webmozart\KeyValueStore\Api\WriteException |
||
98 | * |
||
99 | * @return Response |
||
100 | */ |
||
101 | public function deleteAction(Request $request, $key) |
||
119 | |||
120 | /** |
||
121 | * handleForm. |
||
122 | * |
||
123 | * @param FormInterface $form |
||
124 | * @param Request $request |
||
125 | * |
||
126 | * @return Response |
||
127 | */ |
||
128 | protected function handleForm(FormInterface $form, Request $request) |
||
148 | |||
149 | /** |
||
150 | * onUpdateSuccess. |
||
151 | * |
||
152 | * @param KeyValue $entity |
||
153 | * |
||
154 | * @return View |
||
155 | */ |
||
156 | protected function onUpdateSuccess(KeyValue $entity) |
||
164 | |||
165 | /** |
||
166 | * Returns a HTTP_BAD_REQUEST response when the form submission fails. |
||
167 | * |
||
168 | * @param KeyValue $entity |
||
169 | * |
||
170 | * @return View |
||
171 | */ |
||
172 | protected function onCreateSuccess(KeyValue $entity) |
||
183 | |||
184 | /** |
||
185 | * Returns a HTTP_BAD_REQUEST response when the form submission fails. |
||
186 | * |
||
187 | * @param FormInterface $form |
||
188 | * |
||
189 | * @return View |
||
190 | */ |
||
191 | protected function onError(FormInterface $form) |
||
202 | |||
203 | /** |
||
204 | * createRestForm. |
||
205 | * |
||
206 | * @param string $type |
||
207 | * @param mixed $data |
||
208 | * @param array $options |
||
209 | * |
||
210 | * @return FormInterface |
||
211 | */ |
||
212 | protected function createRestForm($type, $data = null, array $options = []) |
||
221 | |||
222 | /** |
||
223 | * ViewHandler. |
||
224 | */ |
||
225 | protected function getViewHandler() |
||
229 | } |
||
230 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: