Skip to content

Commit 5c6b234

Browse files
committed
Add full support for class methods.
1 parent 72ea260 commit 5c6b234

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

visitor.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ public function enterNode(Node $node)
4949
}
5050

5151
$this->currentSymbolName = $node->name->name;
52+
53+
if ($node instanceof ClassMethod) {
54+
/** @var \PhpParser\Node\Stmt\Class_ $parent */
55+
$parent = $this->stack[count($this->stack) - 2];
56+
57+
$this->currentSymbolName = sprintf(
58+
'%1$s::%2$s',
59+
$parent->name->name,
60+
$node->name->name
61+
);
62+
}
63+
5264
$newDocComment = $this->addArrayHashNotation($docComment);
5365

5466
if ($newDocComment !== null) {

0 commit comments

Comments
 (0)