File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ parameters:
1010
1111 # see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
1212 typeAliases :
13- StmtsAware : \PhpParser\Node\Expr\Closure | \PhpParser\Node\Stmt\Case_ | \PhpParser\Node\Stmt\Catch_ | \PhpParser\Node\Stmt\ClassMethod | \PhpParser\Node\Stmt\Do_ | \PhpParser\Node\Stmt\Else_ | \PhpParser\Node\Stmt\ElseIf_ | \PhpParser\Node\Stmt\Finally_ | \PhpParser\Node\Stmt\For_ | \PhpParser\Node\Stmt\Foreach_ | \PhpParser\Node\Stmt\Function_ | \PhpParser\Node\Stmt\If_ | \PhpParser\Node\Stmt\Namespace_ | \PhpParser\Node\Stmt\TryCatch | \PhpParser\Node\Stmt\While_
13+ StmtsAware : \PhpParser\Node\Stmt\Block | \PhpParser\Node\ Expr\Closure | \PhpParser\Node\Stmt\Case_ | \PhpParser\Node\Stmt\Catch_ | \PhpParser\Node\Stmt\ClassMethod | \PhpParser\Node\Stmt\Do_ | \PhpParser\Node\Stmt\Else_ | \PhpParser\Node\Stmt\ElseIf_ | \PhpParser\Node\Stmt\Finally_ | \PhpParser\Node\Stmt\For_ | \PhpParser\Node\Stmt\Foreach_ | \PhpParser\Node\Stmt\Function_ | \PhpParser\Node\Stmt\If_ | \PhpParser\Node\Stmt\Namespace_ | \PhpParser\Node\Stmt\TryCatch | \PhpParser\Node\Stmt\While_ | \Rector\PhpParser\Node\CustomNode\FileWithoutNamespace
1414
1515 # requires exact closure types
1616 checkMissingCallableSignature : true
Original file line number Diff line number Diff line change 1313use PhpParser \Node \Expr \NullsafeMethodCall ;
1414use PhpParser \Node \Expr \StaticCall ;
1515use PhpParser \Node \FunctionLike ;
16- use PhpParser \Node \Stmt \Block ;
1716use PhpParser \Node \Stmt \ClassLike ;
1817use PhpParser \Node \Stmt \ClassMethod ;
1918use PhpParser \Node \Stmt \Declare_ ;
@@ -69,7 +68,7 @@ private static function reIndexStmtsKeys(Node $node): ?Node
6968 {
7069 if (! NodeGroup::isStmtAwareNode (
7170 $ node
72- ) && ! $ node instanceof ClassLike && ! $ node instanceof Declare_ && ! $ node instanceof Block ) {
71+ ) && ! $ node instanceof ClassLike && ! $ node instanceof Declare_) {
7372 return null ;
7473 }
7574
Original file line number Diff line number Diff line change 66
77use PhpParser \Node ;
88use PhpParser \Node \Expr \Closure ;
9+ use PhpParser \Node \Stmt \Block ;
910use PhpParser \Node \Stmt \Case_ ;
1011use PhpParser \Node \Stmt \Catch_ ;
1112use PhpParser \Node \Stmt \Class_ ;
@@ -38,6 +39,7 @@ final class NodeGroup
3839 * @var array<class-string<Node>>
3940 */
4041 public const STMTS_AWARE = [
42+ Block::class,
4143 Closure::class,
4244 Case_::class,
4345 Catch_::class,
You can’t perform that action at this time.
0 commit comments