Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/PhpParser/Internal/PrintableNewAnonClassNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @internal
*/
class PrintableNewAnonClassNode extends Expr {
class PrintableNewAnonClassNode extends Expr implements Node\ContainsStmts {
/** @var Node\AttributeGroup[] PHP attribute groups */
public array $attrGroups;
/** @var int Modifiers */
Expand Down
11 changes: 11 additions & 0 deletions lib/PhpParser/Node/ContainsStmts.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace PhpParser\Node;

/**
* @property-read Stmt[] $stmts
*/
interface ContainsStmts {
}
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Expr/Closure.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use PhpParser\Node\Expr;
use PhpParser\Node\FunctionLike;

class Closure extends Expr implements FunctionLike {
class Closure extends Expr implements FunctionLike, Node\ContainsStmts {
/** @var bool Whether the closure is static */
public bool $static;
/** @var bool Whether to return by reference */
Expand Down
3 changes: 2 additions & 1 deletion lib/PhpParser/Node/Stmt/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace PhpParser\Node\Stmt;

use PhpParser\Node\ContainsStmts;
use PhpParser\Node\Stmt;

class Block extends Stmt {
class Block extends Stmt implements ContainsStmts {
/** @var Stmt[] Statements */
public array $stmts;

Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Case_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class Case_ extends Node\Stmt {
class Case_ extends Node\Stmt implements Node\ContainsStmts {
/** @var null|Node\Expr Condition (null for default) */
public ?Node\Expr $cond;
/** @var Node\Stmt[] Statements */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Catch_.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use PhpParser\Node;
use PhpParser\Node\Expr;

class Catch_ extends Node\Stmt {
class Catch_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Name[] Types of exceptions to catch */
public array $types;
/** @var Expr\Variable|null Variable for exception */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/ClassLike.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use PhpParser\Node;
use PhpParser\Node\PropertyItem;

abstract class ClassLike extends Node\Stmt {
abstract class ClassLike extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Identifier|null Name */
public ?Node\Identifier $name;
/** @var Node\Stmt[] Statements */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Do_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class Do_ extends Node\Stmt {
class Do_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Stmt[] Statements */
public array $stmts;
/** @var Node\Expr Condition */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/ElseIf_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class ElseIf_ extends Node\Stmt {
class ElseIf_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Expr Condition */
public Node\Expr $cond;
/** @var Node\Stmt[] Statements */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Else_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class Else_ extends Node\Stmt {
class Else_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Stmt[] Statements */
public array $stmts;

Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Finally_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class Finally_ extends Node\Stmt {
class Finally_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Stmt[] Statements */
public array $stmts;

Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/For_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class For_ extends Node\Stmt {
class For_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Expr[] Init expressions */
public array $init;
/** @var Node\Expr[] Loop conditions */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Foreach_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class Foreach_ extends Node\Stmt {
class Foreach_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Expr Expression to iterate */
public Node\Expr $expr;
/** @var null|Node\Expr Variable to assign key to */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Function_.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use PhpParser\Node;
use PhpParser\Node\FunctionLike;

class Function_ extends Node\Stmt implements FunctionLike {
class Function_ extends Node\Stmt implements FunctionLike, Node\ContainsStmts {
/** @var bool Whether function returns by reference */
public bool $byRef;
/** @var Node\Identifier Name */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/If_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class If_ extends Node\Stmt {
class If_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Expr Condition expression */
public Node\Expr $cond;
/** @var Node\Stmt[] Statements */
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/Namespace_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class Namespace_ extends Node\Stmt {
class Namespace_ extends Node\Stmt implements Node\ContainsStmts {
/* For use in the "kind" attribute */
public const KIND_SEMICOLON = 1;
public const KIND_BRACED = 2;
Expand Down
2 changes: 1 addition & 1 deletion lib/PhpParser/Node/Stmt/While_.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use PhpParser\Node;

class While_ extends Node\Stmt {
class While_ extends Node\Stmt implements Node\ContainsStmts {
/** @var Node\Expr Condition */
public Node\Expr $cond;
/** @var Node\Stmt[] Statements */
Expand Down