Skip to content

Commit 6850a22

Browse files
committed
[DX] [DI] Improve exception for invalid setter injection arguments
1 parent a483d37 commit 6850a22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ private function parseDefinition($id, $service, $file, array $defaults)
476476
$args = isset($call[1]) ? $this->resolveServices($call[1], $file) : array();
477477
}
478478

479+
if (!is_array($args)) {
480+
throw new InvalidArgumentException(sprintf('The second parameter for function call "%s" must be an array of its arguments for service "%s" in %s. Check your YAML syntax.', $method, $id, $file));
481+
}
479482
$definition->addMethodCall($method, $args);
480483
}
481484
}

0 commit comments

Comments
 (0)