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

Breadcrumb

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

function PropertyItem::__construct

Constructs a class property item node.

Parameters

string|Node\VarLikeIdentifier $name Name:

null|Node\Expr $default Default value:

array<string, mixed> $attributes Additional attributes:

Overrides NodeAbstract::__construct

File

vendor/nikic/php-parser/lib/PhpParser/Node/PropertyItem.php, line 21

Class

PropertyItem

Namespace

PhpParser\Node

Code

public function __construct($name, ?Node\Expr $default = null, array $attributes = []) {
    $this->attributes = $attributes;
    $this->name = \is_string($name) ? new Node\VarLikeIdentifier($name) : $name;
    $this->default = $default;
}
RSS feed
Powered by Drupal