if (!
$type) { if (isset($arguments[$index])) { continue;
} // no default value? Then fail
if (!
$parameter->
isDefaultValueAvailable()) { // For core classes, isDefaultValueAvailable() can
// be false when isOptional() returns true. If the
// argument *is* optional, allow it to be missing
if ($parameter->
isOptional()) { --
$index;
break;
} $type = ProxyHelper::
exportType($parameter);
$type =
$type ?
sprintf('is type-hinted "%s"',
preg_replace('/(^|[(|&])\\\\|^\?\\\\?/', '\1',
$type)) : 'has no type-hint';
throw new AutowiringFailedException($this->currentId,
sprintf('Cannot autowire service "%s": argument "$%s" of method "%s()" %s, you should configure its value explicitly.',
$this->currentId,
$parameter->name,
$class !==
$this->currentId ?
$class.'::'.
$method :
$method,
$type));
} // specifically pass the default value
$arguments[$index] =
$this->defaultArgument->
withValue($parameter);