[DX] [DI] Improve exception for invalid setter injection arguments

This commit is contained in:
Niels Keurentjes 2018-01-03 12:24:16 +01:00
parent a483d37eaf
commit 6850a228a7

View File

@ -476,6 +476,9 @@ class YamlFileLoader extends FileLoader
$args = isset($call[1]) ? $this->resolveServices($call[1], $file) : array();
}
if (!is_array($args)) {
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));
}
$definition->addMethodCall($method, $args);
}
}