function NodeAbstract::getComments
Gets all comments directly preceding this node.
The comments are also available through the "comments" attribute.
Return value
Comment[]
Overrides Node::getComments
2 calls to NodeAbstract::getComments()
- NodeAbstract::getDocComment in vendor/
nikic/ php-parser/ lib/ PhpParser/ NodeAbstract.php - Gets the doc comment of the node.
- NodeAbstract::setDocComment in vendor/
nikic/ php-parser/ lib/ PhpParser/ NodeAbstract.php - Sets the doc comment of the node.
File
-
vendor/
nikic/ php-parser/ lib/ PhpParser/ NodeAbstract.php, line 107
Class
Namespace
PhpParserCode
public function getComments() : array {
return $this->attributes['comments'] ?? [];
}