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

Breadcrumb

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

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

NodeAbstract

Namespace

PhpParser

Code

public function getComments() : array {
    return $this->attributes['comments'] ?? [];
}

API Navigation

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