Skip to content

Commit 7728361

Browse files
committed
fix
1 parent c17dbe7 commit 7728361

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

build/phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ parameters:
124124
- stubs/ReactStreams.stub
125125
- stubs/NetteDIContainer.stub
126126
- stubs/PhpParserName.stub
127+
- stubs/PhpParserNode.stub
127128
- stubs/PhpParserExpr.stub
128129
- stubs/PhpParserStmt.stub
129130
- stubs/Identifier.stub

build/stubs/PhpParserExpr.stub

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,8 @@ class StaticCall extends CallLike {
100100
*/
101101
public function __construct(Node $class, $name, array $args = [], array $attributes = []) {}
102102
}
103+
104+
class Closure extends Expr implements FunctionLike {
105+
/** @var list<Node\Stmt> Statements */
106+
public array $stmts;
107+
}

build/stubs/PhpParserNode.stub

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace PhpParser\Node;
4+
5+
use PhpParser\NodeAbstract;
6+
7+
class PropertyHook extends NodeAbstract implements FunctionLike {
8+
/** @var null|Expr|list<Stmt> Hook body */
9+
public $body;
10+
}

build/stubs/PhpParserStmt.stub

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ class ClassMethod extends Node\Stmt implements FunctionLike {
1111
public ?array $stmts;
1212
}
1313

14+
class Function_ extends Node\Stmt implements FunctionLike {
15+
/** @var list<Node\Stmt> Statements */
16+
public array $stmts;
17+
}
18+
1419
class If_ extends Node\Stmt {
1520
/** @var list<Node\Stmt> Statements */
1621
public array $stmts;
1722
}
23+

src/Parser/CleaningVisitor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public function enterNode(Node $node): ?Node
5050
}
5151

5252
/**
53-
* @param Node\Stmt[] $stmts
54-
* @return Node\Stmt[]
53+
* @param list<Node\Stmt|Node\Expr> $stmts
54+
* @return list<Node\Stmt>
5555
*/
5656
private function keepVariadicsAndYields(array $stmts, ?string $hookedPropertyName): array
5757
{

0 commit comments

Comments
 (0)