Skip to content

Commit 551af77

Browse files
committed
Regression test for #2906
Closes phpstan/phpstan#2906
1 parent 193ab98 commit 551af77

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ public function dataFileAsserts(): iterable
380380

381381
yield from $this->gatherAssertTypes(__DIR__ . '/data/type-aliases.php');
382382
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-4650.php');
383+
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-2906.php');
383384
}
384385

385386
/**
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
namespace Bug2906;
4+
5+
6+
use function PHPStan\Testing\assertNativeType;
7+
use function PHPStan\Testing\assertType;
8+
9+
class HelloWorld
10+
{
11+
/**
12+
* @param string $thing
13+
* @param mixed $value
14+
*/
15+
public function sayHello($thing, $value): void
16+
{
17+
assertType('false', $thing === null);
18+
assertNativeType('bool', $thing === null);
19+
}
20+
}

0 commit comments

Comments
 (0)