Skip to content

Commit 9e28672

Browse files
Add test
1 parent f871587 commit 9e28672

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/PHPStan/Analyser/nsrt/bug-12244.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,25 @@ public function doSomething(): void {
2020
if ($this !== self::A) {
2121
assertType('$this(Bug12244\X~Bug12244\X::A)', $this);
2222
assertType('null', $this->get());
23+
} else {
24+
assertType('int', $this->get());
25+
}
26+
27+
if ($this !== self::B && $this !== self::C) {
28+
assertType('int', $this->get());
2329
}
2430
}
2531

2632
public static function doSomethingFor(X $x): void {
2733
if ($x !== self::A) {
2834
assertType('Bug12244\X~Bug12244\X::A', $x);
2935
assertType('null', $x->get());
36+
} else {
37+
assertType('int', $x->get());
38+
}
39+
40+
if ($x !== self::B && $x !== self::C) {
41+
assertType('int', $x->get());
3042
}
3143
}
3244
}

0 commit comments

Comments
 (0)