Add missing phpdoc annotations in AST nodes (#946)

This commit is contained in:
RainX 2023-09-19 03:16:54 +08:00 committed by GitHub
parent 8b9488e1e6
commit f4961b89ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -7,8 +7,10 @@ use PhpParser\Node\Expr;
use PhpParser\Node\FunctionLike; use PhpParser\Node\FunctionLike;
class ArrowFunction extends Expr implements FunctionLike { class ArrowFunction extends Expr implements FunctionLike {
/** @var bool Whether the closure is static */
public bool $static; public bool $static;
/** @var bool Whether to return by reference */
public bool $byRef; public bool $byRef;
/** @var Node\Param[] */ /** @var Node\Param[] */
@ -17,6 +19,7 @@ class ArrowFunction extends Expr implements FunctionLike {
/** @var null|Node\Identifier|Node\Name|Node\ComplexType */ /** @var null|Node\Identifier|Node\Name|Node\ComplexType */
public ?Node $returnType; public ?Node $returnType;
/** @var Expr Expression body */
public Expr $expr; public Expr $expr;
/** @var Node\AttributeGroup[] */ /** @var Node\AttributeGroup[] */
public array $attrGroups; public array $attrGroups;

View File

@ -6,12 +6,15 @@ use PhpParser\Node;
use PhpParser\Node\MatchArm; use PhpParser\Node\MatchArm;
class Match_ extends Node\Expr { class Match_ extends Node\Expr {
/** @var Node\Expr Condition */
public Node\Expr $cond; public Node\Expr $cond;
/** @var MatchArm[] */ /** @var MatchArm[] */
public array $arms; public array $arms;
/** /**
* @param Node\Expr $cond Condition
* @param MatchArm[] $arms * @param MatchArm[] $arms
* @param array<string, mixed> $attributes Additional attributes
*/ */
public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) { public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) {
$this->attributes = $attributes; $this->attributes = $attributes;

View File

@ -17,6 +17,7 @@ class Param extends NodeAbstract {
public Expr $var; public Expr $var;
/** @var null|Expr Default value */ /** @var null|Expr Default value */
public ?Expr $default; public ?Expr $default;
/** @var int Optional visibility flags */
public int $flags; public int $flags;
/** @var AttributeGroup[] PHP attribute groups */ /** @var AttributeGroup[] PHP attribute groups */
public array $attrGroups; public array $attrGroups;