We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a2e77f commit 6487002Copy full SHA for 6487002
tests/PHPStan/Analyser/nsrt/bug-13304.php
@@ -4,13 +4,22 @@
4
5
use function PHPStan\Testing\assertType;
6
7
-function foo(object $bar): void
+function foo(object $foo): void
8
{
9
foreach (['qux', 'quux'] as $property) {
10
- if (!property_exists($bar, $property)) {
+ if (!property_exists($foo, $property)) {
11
throw new \Exception;
12
}
13
14
- assertType("object&hasProperty(quux)&hasProperty(qux)", $bar);
+ assertType("object&hasProperty(quux)&hasProperty(qux)", $foo);
15
16
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