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
Namespace
PhpParser\Node\ExprCode
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'] ?? [];
}