File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 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.
200200This interface contains a ``resolve() `` method, which is called for each
201201argument of the controller. It receives the current ``Request `` object and an
202202: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:
206209
207210.. code-block :: php
208211
@@ -214,7 +217,7 @@ argument) or an array with the resolved value(s).
214217 use Symfony\Component\HttpKernel\Controller\ValueResolverInterface;
215218 use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
216219
217- class UserValueResolver implements ValueResolverInterface
220+ class BookingIdValueResolver implements ValueResolverInterface
218221 {
219222 public function resolve(Request $request, ArgumentMetadata $argument): array
220223 {
You can’t perform that action at this time.
0 commit comments