Skip to content

Commit c508fd7

Browse files
Add classname check
1 parent aac8356 commit c508fd7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Type/Symfony/InputInterfaceGetArgumentDynamicReturnTypeExtension.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ public function getTypeFromMethodCall(MethodReflection $methodReflection, Method
7878
}
7979

8080
$method = $scope->getFunction();
81-
if ($method instanceof MethodReflection && $method->getName() === 'interact') {
81+
if (
82+
$method instanceof MethodReflection
83+
&& $method->getName() === 'interact'
84+
&& \in_array('Symfony\Component\Console\Command\Command', $method->getDeclaringClass()->getParentClassesNames(), true)
85+
) {
8286
$argTypes[] = new NullType();
8387
}
8488

0 commit comments

Comments
 (0)