Skip to content

Commit 388b627

Browse files
committed
prevent unwanted calls
1 parent 7620bf4 commit 388b627

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Visitor/Php/Knp/Menu/AbstractKnpMenuVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function isKnpMenuBuildingMethod(Node $node): bool
9999
$returnType = $returnType->type;
100100
}
101101

102-
if (!$returnType instanceof Node\Name) {
102+
if (!$returnType instanceof Node\Name || !method_exists($returnType, 'toCodeString')) {
103103
$this->isKnpMenuBuildingMethod = false;
104104
} else {
105105
$this->isKnpMenuBuildingMethod = 'ItemInterface' === $returnType->toCodeString();

0 commit comments

Comments
 (0)