Skip to content

Commit 871fd97

Browse files
committed
get text explicitly
1 parent 17813d7 commit 871fd97

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/NodeVisitor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,8 @@ function (\PhpParser\Node\Const_ $const) {
420420
// Only @var comments are actual, useful documentation for stubs
421421
if (
422422
$this->needsDocumentedGlobals &&
423-
preg_match('/@(?:[a-z]+-)?var\s/', (string) $node->getDocComment())
423+
$node->getDocComment() &&
424+
preg_match('/@(?:[a-z]+-)?var\s/', $node->getDocComment()->getText())
424425
) {
425426
$this->count('globals', $node->expr->var->name);
426427
return $this->needsDocumentedGlobals;

0 commit comments

Comments
 (0)