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

Breadcrumb

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

function PropertyHook::__construct

Constructs a property hook node.

Parameters

string|Identifier $name Hook name:

null|Expr|Stmt[] $body Hook body:

array{: flags?: int, byRef?: bool, params?: Param[], attrGroups?: AttributeGroup[], } $subNodes Array of the following optional subnodes: 'byRef' => false : Whether hook returns by reference 'params' => array(): Parameters 'attrGroups' => array(): PHP attribute groups

array<string, mixed> $attributes Additional attributes:

Overrides NodeAbstract::__construct

File

vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php, line 38

Class

PropertyHook

Namespace

PhpParser\Node

Code

public function __construct($name, $body, array $subNodes = [], array $attributes = []) {
    $this->attributes = $attributes;
    $this->name = \is_string($name) ? new Identifier($name) : $name;
    $this->body = $body;
    $this->flags = $subNodes['flags'] ?? 0;
    $this->byRef = $subNodes['byRef'] ?? false;
    $this->params = $subNodes['params'] ?? [];
    $this->attrGroups = $subNodes['attrGroups'] ?? [];
}
RSS feed
Powered by Drupal