Skip to content

Commit 9c88daf

Browse files
committed
FIXUP couple more test cases
1 parent d222675 commit 9c88daf

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/PHPStan/Analyser/nsrt/equal-narrow.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ function doFalse($x, $y, $z): void
5959
assertType("0|0.0|''|'0'|array{}|false|null", $x);
6060
}
6161

62+
if (!$x) {
63+
assertType("0|0.0|''|'0'|array{}|false|null", $x);
64+
} else {
65+
assertType("1|'x'|object|true", $x);
66+
}
67+
6268
if ($y == false) {
6369
assertType("0|''|'0'|null", $y);
6470
} else {
@@ -90,6 +96,12 @@ function doTrue($x, $y, $z): void
9096
assertType("1|'x'|object|true", $x);
9197
}
9298

99+
if ($x) {
100+
assertType("1|'x'|object|true", $x);
101+
} else {
102+
assertType("0|0.0|''|'0'|array{}|false|null", $x);
103+
}
104+
93105
if ($y == true) {
94106
assertType("int<min, -1>|int<1, max>|non-falsy-string", $y);
95107
} else {

0 commit comments

Comments
 (0)