Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NodeAbstract.php

function NodeAbstract::getDocComment

Gets the doc comment of the node.

Return value

null|Comment\Doc Doc comment object or null

Overrides Node::getDocComment

File

vendor/nikic/php-parser/lib/PhpParser/NodeAbstract.php, line 116

Class

NodeAbstract

Namespace

PhpParser

Code

public function getDocComment() : ?Comment\Doc {
    $comments = $this->getComments();
    for ($i = count($comments) - 1; $i >= 0; $i--) {
        $comment = $comments[$i];
        if ($comment instanceof Comment\Doc) {
            return $comment;
        }
    }
    return null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal