You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewRuntimeException(sprintf('Cannot autowire service "%s": argument $%s of method %s::%s() must have a type-hint or be given a value explicitly.', $this->currentId, $parameter->name, $reflectionMethod->class, $reflectionMethod->name));
@@ -273,17 +273,17 @@ private function autowireMethod(\ReflectionMethod $reflectionMethod, array $argu
273
273
continue;
274
274
}
275
275
276
-
if ($value = $this->getAutowiredReference($typeName)) {
277
-
$this->usedTypes[$typeName] = $this->currentId;
276
+
if ($value = $this->getAutowiredReference($type)) {
$message = sprintf('Unable to autowire argument of type "%s" for the service "%s". No services were found matching this %s and it cannot be auto-registered.', $typeName, $this->currentId, $classOrInterface);
$message = sprintf('Unable to autowire argument of type "%s" for the service "%s". No services were found matching this %s and it cannot be auto-registered.', $type, $this->currentId, $classOrInterface);
285
285
} else {
286
-
$message = sprintf('Cannot autowire argument $%s of method %s::%s() for service "%s": Class %s does not exist.', $parameter->name, $reflectionMethod->class, $reflectionMethod->name, $this->currentId, $typeName);
286
+
$message = sprintf('Cannot autowire argument $%s of method %s::%s() for service "%s": Class %s does not exist.', $parameter->name, $reflectionMethod->class, $reflectionMethod->name, $this->currentId, $type);
287
287
}
288
288
289
289
thrownewRuntimeException($message);
@@ -313,24 +313,18 @@ private function autowireOverridenGetters(array $overridenGetters, array $autowi
313
313
if (isset($overridenGetters[$lcMethod]) || $reflectionMethod->getNumberOfParameters() || $reflectionMethod->isConstructor()) {
314
314
continue;
315
315
}
316
-
if (!$typeName = InheritanceProxyHelper::getTypeHint($reflectionMethod, null, true)) {
thrownewRuntimeException(sprintf('Cannot autowire service "%s": getter %s::%s() must%s be given a return value explicitly.', $this->currentId, $reflectionMethod->class, $reflectionMethod->name, $typeName ? '' : ' have a return-type hint or'));
319
+
thrownewRuntimeException(sprintf('Cannot autowire service "%s": getter %s::%s() must%s have its return value be configured explicitly.', $this->currentId, $reflectionMethod->class, $reflectionMethod->name, $type ? '' : ' have a return-type hint or'));
320
320
}
321
321
322
-
if (!$typeRef = $this->getAutowiredReference($typeName)) {
$message = sprintf('Unable to autowire return type "%s" for service "%s". No services were found matching this %s and it cannot be auto-registered.', $typeName, $this->currentId, $classOrInterface);
325
-
} else {
326
-
$message = sprintf('Cannot autowire return type of getter %s::%s() for service "%s": Class %s does not exist.', $reflectionMethod->class, $reflectionMethod->name, $this->currentId, $typeName);
327
-
}
328
-
329
-
thrownewRuntimeException($message);
322
+
if (!$typeRef = $this->getAutowiredReference($type)) {
323
+
continue;
330
324
}
331
325
332
326
$overridenGetters[$lcMethod] = $typeRef;
333
-
$this->usedTypes[$typeName] = $this->currentId;
327
+
$this->usedTypes[$type] = $this->currentId;
334
328
}
335
329
336
330
return$overridenGetters;
@@ -339,21 +333,21 @@ private function autowireOverridenGetters(array $overridenGetters, array $autowi
339
333
/**
340
334
* @return Reference|null A reference to the service matching the given type, if any
0 commit comments