File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
tests/PHPStan/Analyser/nsrt Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments