8000 [DX] [DI] Improve exception for invalid setter injection arguments · symfony/symfony@6850a22 · GitHub
[go: up one dir, main page]

Skip to content
Sign in

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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)
0