File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
tests/PHPStan/Rules/Properties Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -433,4 +433,10 @@ public function testBug4526(): void
433
433
$ this ->analyse ([__DIR__ . '/data/bug-4526.php ' ], []);
434
434
}
435
435
436
+ public function testBug7200 (): void
437
+ {
438
+ $ this ->checkExplicitMixed = true ;
439
+ $ this ->analyse ([__DIR__ . '/data/bug-7200.php ' ], []);
440
+ }
441
+
436
442
}
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace Bug7200 ;
4
+
5
+ class HelloWorld
6
+ {
7
+ /**
8
+ * @param class-string<Model&One&Two&Three>|null $class
9
+ */
10
+ public function __construct (public ?Model $ model = null , public ?string $ class = null )
11
+ {
12
+ if ($ model instanceof One && $ model instanceof Two && $ model instanceof Three) {
13
+ $ this ->class ??= $ model ::class;
14
+ }
15
+ }
16
+ }
17
+
18
+ class Model {}
19
+ interface One {}
20
+ interface Two {}
21
+ interface Three {}
You can’t perform that action at this time.
0 commit comments