PhpParser\NodeAbstract::getDocComment PHP Метод

getDocComment() публичный Метод

The doc comment has to be the last comment associated with the node.
public getDocComment ( ) : null | Comment\Doc
Результат null | Comment\Doc Doc comment object or null
    public function getDocComment()
    {
        $comments = $this->getAttribute('comments');
        if (!$comments) {
            return null;
        }
        $lastComment = $comments[count($comments) - 1];
        if (!$lastComment instanceof Comment\Doc) {
            return null;
        }
        return $lastComment;
    }