Skip to content

Commit d4b720d

Browse files
rvanvelzenondrejmirtes
authored andcommitted
Regression test
1 parent 4b22f3d commit d4b720d

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/PHPStan/Rules/Properties/TypesAssignedToPropertiesRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,4 +433,10 @@ public function testBug4526(): void
433433
$this->analyse([__DIR__ . '/data/bug-4526.php'], []);
434434
}
435435

436+
public function testBug7200(): void
437+
{
438+
$this->checkExplicitMixed = true;
439+
$this->analyse([__DIR__ . '/data/bug-7200.php'], []);
440+
}
441+
436442
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 {}

0 commit comments

Comments
 (0)