12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php declare(strict_types=1);
- namespace PhpParser\Node\Expr;
- use PhpParser\Node;
- use PhpParser\Node\Expr;
- use PhpParser\Node\FunctionLike;
- class Closure extends Expr implements FunctionLike
- {
-
- public $static;
-
- public $byRef;
-
- public $params;
-
- public $uses;
-
- public $returnType;
-
- public $stmts;
-
- public $attrGroups;
-
- 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'] ?? [];
- $returnType = $subNodes['returnType'] ?? null;
- $this->returnType = \is_string($returnType) ? new Node\Identifier($returnType) : $returnType;
- $this->stmts = $subNodes['stmts'] ?? [];
- $this->attrGroups = $subNodes['attrGroups'] ?? [];
- }
- public function getSubNodeNames() : array {
- return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts'];
- }
- public function returnsByRef() : bool {
- return $this->byRef;
- }
- public function getParams() : array {
- return $this->params;
- }
- public function getReturnType() {
- return $this->returnType;
- }
-
- public function getStmts() : array {
- return $this->stmts;
- }
- public function getAttrGroups() : array {
- return $this->attrGroups;
- }
- public function getType() : string {
- return 'Expr_Closure';
- }
- }
|