Skip to content

Commit 6487002

Browse files
committed
add new case - appear to have reintroduced 12778
1 parent 7a2e77f commit 6487002

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/PHPStan/Analyser/nsrt/bug-13304.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,22 @@
44

55
use function PHPStan\Testing\assertType;
66

7-
function foo(object $bar): void
7+
function foo(object $foo): void
88
{
99
foreach (['qux', 'quux'] as $property) {
10-
if (!property_exists($bar, $property)) {
10+
if (!property_exists($foo, $property)) {
1111
throw new \Exception;
1212
}
1313

14-
assertType("object&hasProperty(quux)&hasProperty(qux)", $bar);
14+
assertType("object&hasProperty(quux)&hasProperty(qux)", $foo);
1515
}
1616
}
17+
18+
function bar(object $bar): void
19+
{
20+
if (!property_exists($bar, '')) {
21+
throw new \Exception;
22+
}
23+
24+
assertType("object", $bar);
25+
}

0 commit comments

Comments
 (0)