Skip to content

Commit b39f510

Browse files
committed
add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors
1 parent 7362f2b commit b39f510

17 files changed

+135
-1
lines changed

lib/PhpParser/Internal/PrintableNewAnonClassNode.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@
1515
*
1616
* @internal
1717
*/
18+
<<<<<<< HEAD
1819
class PrintableNewAnonClassNode extends Expr {
20+
=======
21+
class PrintableNewAnonClassNode extends Expr implements Node\StmtsIterable
22+
{
23+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
1924
/** @var Node\AttributeGroup[] PHP attribute groups */
2025
public $attrGroups;
2126
/** @var Node\Arg[] Arguments */

lib/PhpParser/Node/Expr/Closure.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
use PhpParser\Node\Expr;
88
use PhpParser\Node\FunctionLike;
99

10+
<<<<<<< HEAD
1011
class Closure extends Expr implements FunctionLike {
12+
=======
13+
class Closure extends Expr implements FunctionLike, Node\StmtsIterable
14+
{
15+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
1116
/** @var bool Whether the closure is static */
1217
public $static;
1318
/** @var bool Whether to return by reference */

lib/PhpParser/Node/Stmt/Case_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
use PhpParser\Node;
66

7+
<<<<<<< HEAD
78
class Case_ extends Node\Stmt {
9+
=======
10+
class Case_ extends Node\Stmt implements Node\StmtsIterable
11+
{
12+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
813
/** @var null|Node\Expr Condition (null for default) */
914
public $cond;
1015
/** @var Node\Stmt[] Statements */
@@ -27,7 +32,11 @@ public function getSubNodeNames(): array {
2732
return ['cond', 'stmts'];
2833
}
2934

35+
<<<<<<< HEAD
3036
public function getType(): string {
37+
=======
38+
public function getType() : string {
39+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
3140
return 'Stmt_Case';
3241
}
3342
}

lib/PhpParser/Node/Stmt/Catch_.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
use PhpParser\Node;
66
use PhpParser\Node\Expr;
77

8+
<<<<<<< HEAD
89
class Catch_ extends Node\Stmt {
10+
=======
11+
class Catch_ extends Node\Stmt implements Node\StmtsIterable
12+
{
13+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
914
/** @var Node\Name[] Types of exceptions to catch */
1015
public $types;
1116
/** @var Expr\Variable|null Variable for exception */

lib/PhpParser/Node/Stmt/ClassMethod.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
use PhpParser\Node;
77
use PhpParser\Node\FunctionLike;
88

9+
<<<<<<< HEAD
910
class ClassMethod extends Node\Stmt implements FunctionLike {
11+
=======
12+
class ClassMethod extends Node\Stmt implements FunctionLike, Node\StmtsIterable
13+
{
14+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
1015
/** @var int Flags */
1116
public $flags;
1217
/** @var bool Whether to return by reference */
@@ -17,7 +22,7 @@ class ClassMethod extends Node\Stmt implements FunctionLike {
1722
public $params;
1823
/** @var null|Node\Identifier|Node\Name|Node\ComplexType Return type */
1924
public $returnType;
20-
/** @var Node\Stmt[]|null Statements */
25+
/** @var Node\Stmt[] Statements */
2126
public $stmts;
2227
/** @var Node\AttributeGroup[] PHP attribute groups */
2328
public $attrGroups;

lib/PhpParser/Node/Stmt/Do_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
use PhpParser\Node;
66

7+
<<<<<<< HEAD
78
class Do_ extends Node\Stmt {
9+
=======
10+
class Do_ extends Node\Stmt implements Node\StmtsIterable
11+
{
12+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
813
/** @var Node\Stmt[] Statements */
914
public $stmts;
1015
/** @var Node\Expr Condition */
@@ -27,7 +32,11 @@ public function getSubNodeNames(): array {
2732
return ['stmts', 'cond'];
2833
}
2934

35+
<<<<<<< HEAD
3036
public function getType(): string {
37+
=======
38+
public function getType() : string {
39+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
3140
return 'Stmt_Do';
3241
}
3342
}

lib/PhpParser/Node/Stmt/ElseIf_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
use PhpParser\Node;
66

7+
<<<<<<< HEAD
78
class ElseIf_ extends Node\Stmt {
9+
=======
10+
class ElseIf_ extends Node\Stmt implements Node\StmtsIterable
11+
{
12+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
813
/** @var Node\Expr Condition */
914
public $cond;
1015
/** @var Node\Stmt[] Statements */
@@ -27,7 +32,11 @@ public function getSubNodeNames(): array {
2732
return ['cond', 'stmts'];
2833
}
2934

35+
<<<<<<< HEAD
3036
public function getType(): string {
37+
=======
38+
public function getType() : string {
39+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
3140
return 'Stmt_ElseIf';
3241
}
3342
}

lib/PhpParser/Node/Stmt/Else_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
use PhpParser\Node;
66

7+
<<<<<<< HEAD
78
class Else_ extends Node\Stmt {
9+
=======
10+
class Else_ extends Node\Stmt implements Node\StmtsIterable
11+
{
12+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
813
/** @var Node\Stmt[] Statements */
914
public $stmts;
1015

@@ -23,7 +28,11 @@ public function getSubNodeNames(): array {
2328
return ['stmts'];
2429
}
2530

31+
<<<<<<< HEAD
2632
public function getType(): string {
33+
=======
34+
public function getType() : string {
35+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
2736
return 'Stmt_Else';
2837
}
2938
}

lib/PhpParser/Node/Stmt/Finally_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
use PhpParser\Node;
66

7+
<<<<<<< HEAD
78
class Finally_ extends Node\Stmt {
9+
=======
10+
class Finally_ extends Node\Stmt implements Node\StmtsIterable
11+
{
12+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
813
/** @var Node\Stmt[] Statements */
914
public $stmts;
1015

@@ -23,7 +28,11 @@ public function getSubNodeNames(): array {
2328
return ['stmts'];
2429
}
2530

31+
<<<<<<< HEAD
2632
public function getType(): string {
33+
=======
34+
public function getType() : string {
35+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
2736
return 'Stmt_Finally';
2837
}
2938
}

lib/PhpParser/Node/Stmt/For_.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
use PhpParser\Node;
66

7+
<<<<<<< HEAD
78
class For_ extends Node\Stmt {
9+
=======
10+
class For_ extends Node\Stmt implements Node\StmtsIterable
11+
{
12+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
813
/** @var Node\Expr[] Init expressions */
914
public $init;
1015
/** @var Node\Expr[] Loop conditions */
@@ -36,7 +41,11 @@ public function getSubNodeNames(): array {
3641
return ['init', 'cond', 'loop', 'stmts'];
3742
}
3843

44+
<<<<<<< HEAD
3945
public function getType(): string {
46+
=======
47+
public function getType() : string {
48+
>>>>>>> 920aae4f (add StmtsIterable interface to mark nodes that contain iterable stmts to improve hooking in node visitors)
4049
return 'Stmt_For';
4150
}
4251
}

0 commit comments

Comments
 (0)