We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aaa670c commit 1fc157eCopy full SHA for 1fc157e
tests/PHPStan/Rules/Variables/data/bug-12597.php
@@ -20,3 +20,33 @@ public function test(int $type): void
20
21
public function message(string $message): void {}
22
}
23
+
24
+class HelloWorld2
25
+{
26
+ public function test(mixed $type): void
27
+ {
28
+ if (is_int($type) || is_object($type)) {
29
+ $message = 'Hello!';
30
+ }
31
32
+ if (is_int($type)) {
33
+ $this->message($message);
34
35
36
37
+ public function test2(mixed $type): void
38
39
+ if ($type instanceof Foo || $type instanceof Bar) {
40
41
42
43
+ if ($type instanceof Foo) {
44
45
46
47
48
+ public function message(string $message): void
49
50
51
+}
52
0 commit comments