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

Breadcrumb

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

function Identifier::__construct

Constructs an identifier node.

Parameters

string $name Identifier as string:

array<string, mixed> $attributes Additional attributes:

Overrides NodeAbstract::__construct

File

vendor/nikic/php-parser/lib/PhpParser/Node/Identifier.php, line 30

Class

Identifier
Represents a non-namespaced name. Namespaced names are represented using Name nodes.

Namespace

PhpParser\Node

Code

public function __construct(string $name, array $attributes = []) {
    if ($name === '') {
        throw new \InvalidArgumentException('Identifier name cannot be empty');
    }
    $this->attributes = $attributes;
    $this->name = $name;
}
RSS feed
Powered by Drupal