File tree Expand file tree Collapse file tree 2 files changed +32
-30
lines changed
tests/PHPStan/Rules/Variables/data Expand file tree Collapse file tree 2 files changed +32
-30
lines changed Original file line number Diff line number Diff line change @@ -17,3 +17,35 @@ public function test(mixed $type): void
1717
1818 public function message (string $ message ): void {}
1919}
20+
21+ class Foo {}
22+ class Bar {}
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+ $ message = 'Hello! ' ;
41+ }
42+
43+ if ($ type instanceof Foo) {
44+ $ this ->message ($ message );
45+ }
46+ }
47+
48+ public function message (string $ message ): void
49+ {
50+ }
51+ }
Original file line number Diff line number Diff line change @@ -20,33 +20,3 @@ public function test(int $type): void
2020
2121 public function message (string $ message ): void {}
2222}
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- $ message = 'Hello! ' ;
41- }
42-
43- if ($ type instanceof Foo) {
44- $ this ->message ($ message );
45- }
46- }
47-
48- public function message (string $ message ): void
49- {
50- }
51- }
52-
You can’t perform that action at this time.
0 commit comments