Skip to content

Commit 921fd9a

Browse files
committed
Regression test
Closes phpstan/phpstan#7789
1 parent 9216c82 commit 921fd9a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/PHPStan/Rules/Properties/TypesAssignedToPropertiesRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,10 @@ public function testBug3311b(): void
514514
]);
515515
}
516516

517+
public function testBug7789(): void
518+
{
519+
$this->checkExplicitMixed = true;
520+
$this->analyse([__DIR__ . '/data/bug-7789.php'], []);
521+
}
522+
517523
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Bug7789;
4+
5+
class HelloWorld
6+
{
7+
/** @var '"'|'\'' */
8+
public static $u;
9+
}
10+
11+
function (): void {
12+
HelloWorld::$u = '"';
13+
HelloWorld::$u = '\'';
14+
};

0 commit comments

Comments
 (0)