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

Breadcrumb

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

function Closure::__construct

Constructs a lambda function node.

Parameters

array{: static?: bool, byRef?: bool, params?: Node\Param[], uses?: ClosureUse[], returnType?: null|Node\Identifier|Node\Name|Node\ComplexType, stmts?: Node\Stmt[], attrGroups?: Node\AttributeGroup[], } $subNodes Array of the following optional subnodes: 'static' => false : Whether the closure is static 'byRef' => false : Whether to return by reference 'params' => array(): Parameters 'uses' => array(): use()s 'returnType' => null : Return type 'stmts' => array(): Statements 'attrGroups' => array(): PHP attributes groups

array<string, mixed> $attributes Additional attributes:

File

vendor/nikic/php-parser/lib/PhpParser/Node/Expr/Closure.php, line 47

Class

Closure

Namespace

PhpParser\Node\Expr

Code

public function __construct(array $subNodes = [], array $attributes = []) {
    $this->attributes = $attributes;
    $this->static = $subNodes['static'] ?? false;
    $this->byRef = $subNodes['byRef'] ?? false;
    $this->params = $subNodes['params'] ?? [];
    $this->uses = $subNodes['uses'] ?? [];
    $this->returnType = $subNodes['returnType'] ?? null;
    $this->stmts = $subNodes['stmts'] ?? [];
    $this->attrGroups = $subNodes['attrGroups'] ?? [];
}
RSS feed
Powered by Drupal