File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ public function dataFileAsserts(): iterable
121121 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/inherit-phpdoc-merging-template.php ' );
122122 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-3266.php ' );
123123 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-3269.php ' );
124+ yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-5086.php ' );
124125 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/assign-nested-arrays.php ' );
125126 yield from $ this ->gatherAssertTypes (__DIR__ . '/data/bug-3276.php ' );
126127 yield from $ this ->gatherAssertTypes (__DIR__ . '/../Rules/Methods/data/bug-6856.php ' );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Bug5086 ;
4+
5+ use stdClass ;
6+ use function PHPStan \Testing \assertType ;
7+
8+ class Foo
9+ {
10+
11+ public function doFoo (): ?object
12+ {
13+
14+ }
15+
16+ public function doBar (): void
17+ {
18+ /** @var stdClass $obj */
19+ if (!($ obj = $ this ->doFoo ())) {
20+ return ;
21+ }
22+
23+ assertType (stdClass::class, $ obj );
24+ }
25+
26+ }
You can’t perform that action at this time.
0 commit comments