Skip to content

Commit

Permalink
Add missing phpdoc annotations in AST nodes (#946)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainx committed Sep 18, 2023
1 parent 8b9488e commit f4961b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/PhpParser/Node/Expr/ArrowFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use PhpParser\Node\FunctionLike;

class ArrowFunction extends Expr implements FunctionLike {
/** @var bool Whether the closure is static */
public bool $static;

/** @var bool Whether to return by reference */
public bool $byRef;

/** @var Node\Param[] */
Expand All @@ -17,6 +19,7 @@ class ArrowFunction extends Expr implements FunctionLike {
/** @var null|Node\Identifier|Node\Name|Node\ComplexType */
public ?Node $returnType;

/** @var Expr Expression body */
public Expr $expr;
/** @var Node\AttributeGroup[] */
public array $attrGroups;
Expand Down
3 changes: 3 additions & 0 deletions lib/PhpParser/Node/Expr/Match_.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
use PhpParser\Node\MatchArm;

class Match_ extends Node\Expr {
/** @var Node\Expr Condition */
public Node\Expr $cond;
/** @var MatchArm[] */
public array $arms;

/**
* @param Node\Expr $cond Condition
* @param MatchArm[] $arms
* @param array<string, mixed> $attributes Additional attributes
*/
public function __construct(Node\Expr $cond, array $arms = [], array $attributes = []) {
$this->attributes = $attributes;
Expand Down
1 change: 1 addition & 0 deletions lib/PhpParser/Node/Param.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Param extends NodeAbstract {
public Expr $var;
/** @var null|Expr Default value */
public ?Expr $default;
/** @var int Optional visibility flags */
public int $flags;
/** @var AttributeGroup[] PHP attribute groups */
public array $attrGroups;
Expand Down

0 comments on commit f4961b8

Please sign in to comment.