Skip to content

Commit 2273dd0

Browse files
committed
WIP another fix
1 parent 56d9544 commit 2273dd0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

tests/PHPStan/Rules/Comparison/ElseIfConstantConditionRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ public function testBug11674(): void
135135
'Elseif condition is always false.',
136136
28,
137137
],
138+
[
139+
'Elseif condition is always false.',
140+
36,
141+
],
138142
]);
139143
}
140144

tests/PHPStan/Rules/Comparison/data/bug-11674.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ function show() : void {
1010
if ((int) $this->param) {
1111
echo 1;
1212
} elseif ($this->param) {
13-
echo 2;
13+
echo 2; // might be "0"
1414
}
1515
}
1616

1717
function show2() : void {
1818
if ((float) $this->param) {
1919
echo 1;
2020
} elseif ($this->param) {
21-
echo 2;
21+
echo 2; // might be "0"
2222
}
2323
}
2424

2525
function show3() : void {
2626
if ((bool) $this->param) {
2727
echo 1;
2828
} elseif ($this->param) {
29-
echo 2;
29+
echo 2; // not possible
3030
}
3131
}
3232

3333
function show4() : void {
3434
if ((string) $this->param) {
3535
echo 1;
3636
} elseif ($this->param) {
37-
echo 2;
37+
echo 2; // not possible
3838
}
3939
}
4040
}

0 commit comments

Comments
 (0)