8000 [WIP] [DependencyInjection] Fix a wrong error when using a factory an… · symfony/symfony@6981fff · GitHub
[go: up one dir, main page]

Skip to content

Commit 6981fff

Browse files
author
Amrouche Hamza
committed
[WIP] [DependencyInjection] Fix a wrong error when using a factory and a call
1 parent 9793522 commit 6981fff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,14 @@ protected function processValue($value, $isRoot = false)
115115
if ($method instanceof \ReflectionFunctionAbstract) {
116116
$reflectionMethod = $method;
117117
} else {
118-
$reflectionMethod = $this->getReflectionMethod($value, $method);
118+
try {
119+
$reflectionMethod = $this->getReflectionMethod($value, $method);
120+
} catch (RuntimeException $e) {
121+
if ($value->getFactory()) {
122+
continue;
123+
}
124+
throw $e;
125+
}
119126
}
120127

121128
foreach ($reflectionMethod->getParameters() as $key => $parameter) {

0 commit comments

Comments
 (0)
0