diff --git a/src/Visitor/Php/Symfony/FormTypeLabelImplicit.php b/src/Visitor/Php/Symfony/FormTypeLabelImplicit.php index 72f78bb..1821878 100644 --- a/src/Visitor/Php/Symfony/FormTypeLabelImplicit.php +++ b/src/Visitor/Php/Symfony/FormTypeLabelImplicit.php @@ -34,7 +34,7 @@ public function enterNode(Node $node): ?Node if ($node instanceof Node\Expr\MethodCall && (!\is_object($node->name) || method_exists($node->name, '__toString')) && ('add' === (string) $node->name || 'create' === (string) $node->name) - && $node->args[0]->value instanceof Node\Scalar\String_) { + && \count($node->args) > 0 && $node->args[0]->value instanceof Node\Scalar\String_) { $skipLabel = false; // Check if the form type is "hidden" if (\count($node->args) >= 2) {