diff --git a/phpstan.neon b/phpstan.neon index 375f1f41..28f211c2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -10,7 +10,7 @@ parameters: # see https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases typeAliases: - 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 + 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_ # requires exact closure types checkMissingCallableSignature: true diff --git a/rules/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector.php b/rules/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector.php index 931b9f32..686e55ec 100644 --- a/rules/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector.php +++ b/rules/DowngradePhp85/Rector/Expression/DowngradeVoidCastRector.php @@ -75,10 +75,7 @@ public function refactor(Node $node): ?Node // the assign is needed to avoid warning // see https://3v4l.org/ie68D#v8.5.3 vs https://3v4l.org/nLc5J#v8.5.3 - $node->expr = new Assign( - $variable, - $node->expr->expr - ); + $node->expr = new Assign($variable, $node->expr->expr); return $node; } }