Skip to content

Commit

Permalink
[CodeQuality] Improve SimplifyIfElseToTernaryRector performance (#3721)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed May 8, 2023
1 parent 18e5ad9 commit ebc75d4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ private function resolveOnlyStmtAssignExpr(array $stmts): ?Expr
private function haveNestedTernary(array $nodes): bool
{
foreach ($nodes as $node) {
$betterNodeFinderFindInstanceOf = $this->betterNodeFinder->findInstanceOf($node, Ternary::class);
if ($betterNodeFinderFindInstanceOf !== []) {
$ternary = $this->betterNodeFinder->findFirstInstanceOf($node, Ternary::class);
if ($ternary instanceof Ternary) {
return true;
}
}
Expand Down

0 comments on commit ebc75d4

Please sign in to comment.