Skip to content

Commit

Permalink
Fix global variables wrongly parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucisu committed Oct 4, 2022
1 parent b6ba987 commit 6540706
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/class-file-reflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function enterNode( \PHPParser_Node $node ) {
// we don't ignore them, we'll end up picking up docblocks that are already
// associated with a named element, and so aren't really from a non-
// documentable element after all.
if ( ! $this->isNodeDocumentable( $node ) && 'Name' !== $node->getType() && ( $docblock = $node->getDocComment() ) ) {
if ( ! $this->isNodeDocumentable( $node ) && ! in_array( $node->getType(), array( 'Name', 'Stmt_Global' ), true ) && ( $docblock = $node->getDocComment() ) ) {
$this->last_doc = $docblock;
}
}
Expand Down

0 comments on commit 6540706

Please sign in to comment.