Aggiornato Composer

This commit is contained in:
Paolo A
2024-05-17 12:24:19 +00:00
parent 4ac62108b5
commit ec201d75b2
2238 changed files with 38684 additions and 59785 deletions

View File

@@ -3,38 +3,46 @@
namespace PhpParser\Node\Expr;
use PhpParser\Node;
use PhpParser\Node\ClosureUse;
use PhpParser\Node\Expr;
use PhpParser\Node\FunctionLike;
class Closure extends Expr implements FunctionLike
{
class Closure extends Expr implements FunctionLike {
/** @var bool Whether the closure is static */
public $static;
public bool $static;
/** @var bool Whether to return by reference */
public $byRef;
public bool $byRef;
/** @var Node\Param[] Parameters */
public $params;
public array $params;
/** @var ClosureUse[] use()s */
public $uses;
public array $uses;
/** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */
public $returnType;
public ?Node $returnType;
/** @var Node\Stmt[] Statements */
public $stmts;
public array $stmts;
/** @var Node\AttributeGroup[] PHP attribute groups */
public $attrGroups;
public array $attrGroups;
/**
* Constructs a lambda function node.
*
* @param array $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
* @param array $attributes Additional attributes
* @param 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
* @param array<string, mixed> $attributes Additional attributes
*/
public function __construct(array $subNodes = [], array $attributes = []) {
$this->attributes = $attributes;
@@ -42,21 +50,20 @@ class Closure extends Expr implements FunctionLike
$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->returnType = $subNodes['returnType'] ?? null;
$this->stmts = $subNodes['stmts'] ?? [];
$this->attrGroups = $subNodes['attrGroups'] ?? [];
}
public function getSubNodeNames() : array {
public function getSubNodeNames(): array {
return ['attrGroups', 'static', 'byRef', 'params', 'uses', 'returnType', 'stmts'];
}
public function returnsByRef() : bool {
public function returnsByRef(): bool {
return $this->byRef;
}
public function getParams() : array {
public function getParams(): array {
return $this->params;
}
@@ -65,15 +72,15 @@ class Closure extends Expr implements FunctionLike
}
/** @return Node\Stmt[] */
public function getStmts() : array {
public function getStmts(): array {
return $this->stmts;
}
public function getAttrGroups() : array {
public function getAttrGroups(): array {
return $this->attrGroups;
}
public function getType() : string {
public function getType(): string {
return 'Expr_Closure';
}
}