Skip to content

Commit

Permalink
[DX] Remove extra check for Stmt/Node (#1314)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
TomasVotruba and actions-user committed Nov 25, 2021
1 parent 53c12d4 commit 76e0c15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Expand Up @@ -94,7 +94,8 @@ public function provideMinPhpVersion(): int
}

private function applyVariadicParams(
ClassMethod | Function_ | Closure $node, string $variableName
ClassMethod | Function_ | Closure $node,
string $variableName
): ClassMethod | Function_ | Closure | null {
$param = $this->createVariadicParam($variableName);
$variableParam = $param->var;
Expand Down
5 changes: 0 additions & 5 deletions src/Rector/AbstractRector.php
Expand Up @@ -275,11 +275,6 @@ final public function enterNode(Node $node)
}
}

// if Stmt ("$value;") was replaced by Expr ("$value"), add Expression (the ending ";") to prevent breaking the code
if ($originalNode instanceof Stmt && $node instanceof Expr) {
$node = new Expression($node);
}

return $node;
}

Expand Down

0 comments on commit 76e0c15

Please sign in to comment.