Skip to content

Commit 87d61c0

Browse files
committed
[DowngradePhp80] Add DowngradeSubstrFalsyRector
1 parent fbcb5d4 commit 87d61c0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rules/DowngradePhp80/Rector/FuncCall/DowngradeSubstrFalsyRector.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ public function refactor(Node $node): ?Node
5151
return null;
5252
}
5353

54-
if ($node instanceof Ternary && ! $node->if instanceof Expr) {
55-
$node->cond->setAttribute(self::IS_UNCASTABLE, true);
54+
if ($node instanceof Ternary) {
55+
if ($node->if instanceof Expr) {
56+
$node->cond->setAttribute(self::IS_UNCASTABLE, true);
57+
}
58+
5659
return null;
5760
}
5861

0 commit comments

Comments
 (0)