throw new InvalidArgumentException(sprintf('Invalid "controller.service_arguments" tag for service "%s": method "%s()" has no "%s" argument on class "%s".',
$id,
$r->name,
$attributes['argument'
],
$class));
} } foreach ($methods as [$r,
$parameters]) { /** @var \ReflectionMethod $r */
// create a per-method map of argument-names to service/type-references
$args =
[];
foreach ($parameters as $p) { /** @var \ReflectionParameter $p */
$type =
preg_replace('/(^|[(|&])\\\\/', '\1',
$target =
ltrim(ProxyHelper::
exportType($p) ?? '', '?'
));
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
$autowireAttributes =
$autowire ?
$emptyAutowireAttributes :
[];
if (isset($arguments[$r->name
][$p->name
])) { $target =
$arguments[$r->name
][$p->name
];
if ('?' !==
$target[0
]) { $invalidBehavior = ContainerInterface::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE;
} elseif ('' ===
$target =
(string) substr($target, 1
)) { throw new InvalidArgumentException(sprintf('A "controller.service_arguments" tag must have non-empty "id" attributes for service "%s".',
$id));
} elseif ($p->
allowsNull() && !
$p->
isOptional()) { $invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
}