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 =
[];
if ($this->namedResolvers &&
$attributes =
$metadata->
getAttributesOfType(ValueResolver::
class,
$metadata::IS_INSTANCEOF
)) { $resolverName = null;
foreach ($attributes as $attribute) { if ($attribute->disabled
) { $disabledResolvers[$attribute->resolver
] = true;
} elseif ($resolverName) { throw new \
LogicException(sprintf('You can only pin one resolver per argument, but argument "$%s" of "%s()" has more.',
$metadata->
getName(),
$this->
getPrettyName($controller)));
} else {