diff --git a/src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php b/src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
index <HASH>..<HASH> 100644
--- a/src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
+++ b/src/phpDocumentor/Reflection/NodeVisitor/ElementNameResolver.php
@@ -94,11 +94,11 @@ final class ElementNameResolver extends NodeVisitorAbstract
             case Function_::class:
                 $this->parts->push($node->name . '()');
                 $node->fqsen = new Fqsen($this->buildName());
-                break;
+                return NodeTraverser::DONT_TRAVERSE_CHILDREN;
             case ClassMethod::class:
                 $this->parts->push('::' . $node->name . '()');
                 $node->fqsen = new Fqsen($this->buildName());
-                break;
+                return NodeTraverser::DONT_TRAVERSE_CHILDREN;
             case ClassConst::class:
                 $this->parts->push('::');
                 break;
Add don't traverse for methods and functions

phpdocumentor doesn't handle the internals of a method so we don't care
about the internal iterations. Our name resolver only has to resolve FQSEN.