8000 fix case when I have a Definition when checking type hint · symfony/symfony@35a0b88 · GitHub
[go: up one dir, main page]

Skip to content

Commit 35a0b88

Browse files
committed
fix case when I have a Definition when checking type hint
1 parent 3e27af1 commit 35a0b88

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,13 @@ private function checkArgumentsTypeHints(\ReflectionFunctionAbstract $reflection
107107
*/
108108 8627
private function checkTypeHint($configurationArgument, \ReflectionParameter $parameter): void
109109
{
110-
if ($configurationArgument instanceof Reference) {
111-
$referencedDefinition = $this->container->findDefinition((string) $configurationArgument);
110+
$referencedDefinition = $configurationArgument;
111+
112+
if ($referencedDefinition instanceof Reference) {
113+
$referencedDefinition = $this->container->findDefinition((string) $referencedDefinition);
114+
}
115+
116+
if ($referencedDefinition instanceof Definition) {
112117
$class = $this->getClassName($referencedDefinition);
113118

114119
if (!$this->autoload && !class_exists($class, false)) {

0 commit comments

Comments
 (0)
0