Skip to content

Commit 5f4d512

Browse files
committed
[CodeQuality] Add regression fixtures for parentheses around unary-prefixed and nested compound assigns in LogicalToBooleanRector (#9807, #9808)
1 parent 391bc0b commit 5f4d512

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
$x = 0;
4+
2 * $x += 42 and true;
5+
2 * ($x += 42) and true;
6+
7+
?>
8+
-----
9+
<?php
10+
11+
$x = 0;
12+
2 * ($x += 42) && true;
13+
2 * ($x += 42) && true;
14+
15+
?>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
!$x = 42 and true;
4+
~$x = 42 and true;
5+
(int) $x = 42 and true;
6+
!$x -= 42 and true;
7+
8+
?>
9+
-----
10+
<?php
11+
12+
!($x = 42) && true;
13+
~($x = 42) && true;
14+
(int) ($x = 42) && true;
15+
!($x -= 42) && true;
16+
17+
?>

0 commit comments

Comments
 (0)