final class ArgumentResolver implements ArgumentResolverInterface
{ private ArgumentMetadataFactoryInterface
$argumentMetadataFactory;
private iterable
$argumentValueResolvers;
private ?ContainerInterface
$namedResolvers;
/**
* @param iterable<mixed, ArgumentValueResolverInterface|ValueResolverInterface> $argumentValueResolvers
*/
public function __construct(ArgumentMetadataFactoryInterface
$argumentMetadataFactory = null, iterable
$argumentValueResolvers =
[], ContainerInterface
$namedResolvers = null
) { $this->argumentMetadataFactory =
$argumentMetadataFactory ??
new ArgumentMetadataFactory();
$this->argumentValueResolvers =
$argumentValueResolvers ?: self::
getDefaultArgumentValueResolvers();
$this->namedResolvers =
$namedResolvers;
} public function getArguments(Request
$request, callable
$controller, \ReflectionFunctionAbstract
$reflector = null
): array
{ $arguments =
[];
foreach ($this->argumentMetadataFactory->
createArgumentMetadata($controller,
$reflector) as $metadata) { $argumentValueResolvers =
$this->argumentValueResolvers;
$disabledResolvers =
[];