Skip to content

Commit 60a8bf1

Browse files
committed
[DI] Skip unknown method calls for factories in check types pass
1 parent a8a9e69 commit 60a8bf1

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Symfony\Component\DependencyInjection\Definition;
1717
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
1818
use Symfony\Component\DependencyInjection\Exception\InvalidParameterTypeException;
19+
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
1920
use Symfony\Component\DependencyInjection\Parameter;
2021
use Symfony\Component\DependencyInjection\Reference;
2122
use Symfony\Component\DependencyInjection\ServiceLocator;
@@ -71,7 +72,15 @@ protected function processValue($value, $isRoot = false)
7172
}
7273

7374
foreach ($value->getMethodCalls() as $methodCall) {
74-
$reflectionMethod = $this->getReflectionMethod($value, $methodCall[0]);
75+
try {
76+
$reflectionMethod = $this->getReflectionMethod($value, $methodCall[0]);
77+
} catch (RuntimeException $e) {
78+
if ($value->getFactory()) {
79+
continue;
80+
}
81+
82+
throw $e;
83+
}
7584

7685
$this->checkTypeDeclarations($value, $reflectionMethod, $methodCall[1]);
7786
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy