File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,7 @@ public function dataFileAsserts(): iterable
164
164
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/classPhpDocs.php ' );
165
165
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/non-empty-array-key-type.php ' );
166
166
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-3133.php ' );
167
+ yield from $ this ->gatherAssertTypes (__DIR__ . '/../Rules/Variables/data/bug-10577.php ' );
167
168
yield from $ this ->gatherAssertTypes (__DIR__ . '/../Rules/Comparison/data/bug-2550.php ' );
168
169
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-2899.php ' );
169
170
yield from $ this ->gatherAssertTypes (__DIR__ . '/data/preg_split.php ' );
Original file line number Diff line number Diff line change 2
2
3
3
namespace Bug10577 ;
4
4
5
+ use function PHPStan \Testing \assertType ;
6
+
5
7
class HelloWorld
6
8
{
7
9
private const MAP = [
@@ -20,6 +22,8 @@ public function validate(string $value): void
20
22
21
23
$ value = self ::MAP [$ value ] ?? $ value ;
22
24
25
+ assertType ("'Test1'|'Test2' " , self ::MAP [$ value ]);
26
+
23
27
// ...
24
28
}
25
29
}
You can’t perform that action at this time.
0 commit comments