Skip to content

Commit 6540706

Browse files
committed
Fix global variables wrongly parsed
1 parent b6ba987 commit 6540706

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/class-file-reflector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function enterNode( \PHPParser_Node $node ) {
126126
// we don't ignore them, we'll end up picking up docblocks that are already
127127
// associated with a named element, and so aren't really from a non-
128128
// documentable element after all.
129-
if ( ! $this->isNodeDocumentable( $node ) && 'Name' !== $node->getType() && ( $docblock = $node->getDocComment() ) ) {
129+
if ( ! $this->isNodeDocumentable( $node ) && ! in_array( $node->getType(), array( 'Name', 'Stmt_Global' ), true ) && ( $docblock = $node->getDocComment() ) ) {
130130
$this->last_doc = $docblock;
131131
}
132132
}

0 commit comments

Comments
 (0)