File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -200,9 +200,12 @@ and defining a service for it.
200
200
This interface contains a ``resolve() `` method, which is called for each
201
201
argument of the controller. It receives the current ``Request `` object and an
202
202
:class: `Symfony\\ Component\\ HttpKernel\\ ControllerMetadata\\ ArgumentMetadata `
203
- instance, which contains all information from the method signature. The
204
- method should return either an empty array (if it cannot resolve this
205
- argument) or an array with the resolved value(s).
203
+ instance, which contains all information from the method signature.
204
+
205
+ The ``resolve() `` method should return either an empty array (if it cannot resolve
206
+ this argument) or an array with the resolved value(s). Usually arguments are
207
+ resolved as a single value, but variadic arguments require resolving multiple
208
+ values. That's why you must always return an array, even for single values:
206
209
207
210
.. code-block :: php
208
211
@@ -214,7 +217,7 @@ argument) or an array with the resolved value(s).
214
217
use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
215
218
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
216
219
217
- class UserValueResolver implements ValueResolverInterface
220
+ class BookingIdValueResolver implements ValueResolverInterface
218
221
{
219
222
public function resolve(Request $request, ArgumentMetadata $argument): array
220
223
{
You can’t perform that action at this time.
0 commit comments