Skip to content

Commit ba1b7f9

Browse files
committed
Update bug-4821.php
1 parent f451cc7 commit ba1b7f9

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,26 @@ public function sayHello(): void
1616
return;
1717
} catch (\ReflectionException $e) {
1818
assertVariableCertainty(TrinaryLogic::createYes(), $object);
19-
assertVariableCertainty(TrinaryLogic::createMaybe(), $method);
19+
assertVariableCertainty(TrinaryLogic::createNo(), $method);
2020
}
2121
}
22+
23+
public function sayHello2(): void
24+
{
25+
$method = rand(0, 1) ? 'nonExisting' : 'sayFoo';
26+
try {
27+
$object = new HelloWorld();
28+
$method = new \ReflectionMethod($object, $method);
29+
$method->invoke($object);
30+
return;
31+
} catch (\ReflectionException $e) {
32+
assertVariableCertainty(TrinaryLogic::createYes(), $object);
33+
assertVariableCertainty(TrinaryLogic::createYes(), $method);
34+
}
35+
}
36+
37+
public function sayFoo(): void
38+
{
39+
40+
}
2241
}

0 commit comments

Comments
 (0)