Skip to content

Commit 20119d2

Browse files
committed
Regression test
Closes phpstan/phpstan#4741
1 parent ac23ecd commit 20119d2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ public function dataFileAsserts(): iterable
505505
yield from $this->gatherAssertTypes(__DIR__ . '/data/array_map_multiple.php');
506506
yield from $this->gatherAssertTypes(__DIR__ . '/data/range-numeric-string.php');
507507
yield from $this->gatherAssertTypes(__DIR__ . '/data/missing-closure-native-return-typehint.php');
508+
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-4741.php');
508509
}
509510

510511
/**
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Bug4741;
4+
5+
use function PHPStan\Testing\assertType;
6+
7+
class Foo
8+
{
9+
10+
public function isAnObject($object): void {
11+
$class = get_class($object);
12+
assertType('class-string|false', $class);
13+
}
14+
15+
}

0 commit comments

Comments
 (0)