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
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
+52-37Lines changed: 52 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -219,54 +219,69 @@ private function autowireMethod(\ReflectionMethod $reflectionMethod, array $argu
219
219
continue;
220
220
}
221
221
222
-
try {
223
-
if (!$typeHint = $parameter->getClass()) {
224
-
// no default value? Then fail
225
-
if (!$parameter->isOptional()) {
226
-
if ($mustAutowire) {
227
-
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));
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));
0 commit comments