File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
tests/PHPStan/Rules/Functions Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 1010use PhpParser \Node \Expr \Assign ;
1111use PhpParser \Node \Expr \AssignRef ;
1212use PhpParser \Node \Expr \ConstFetch ;
13+ use PhpParser \Node \Expr \FuncCall ;
1314use PhpParser \Node \Expr \List_ ;
1415use PhpParser \Node \Expr \MethodCall ;
1516use PhpParser \Node \Expr \PropertyFetch ;
@@ -863,6 +864,7 @@ private function processSureTypesForConditionalExpressionsAfterAssign(Scope $sco
863864 } elseif (
864865 !$ expr instanceof PropertyFetch
865866 && !$ expr instanceof ArrayDimFetch
867+ && !$ expr instanceof FuncCall
866868 ) {
867869 continue ;
868870 }
@@ -901,6 +903,7 @@ private function processSureNotTypesForConditionalExpressionsAfterAssign(Scope $
901903 } elseif (
902904 !$ expr instanceof PropertyFetch
903905 && !$ expr instanceof ArrayDimFetch
906+ && !$ expr instanceof FuncCall
904907 ) {
905908 continue ;
906909 }
Original file line number Diff line number Diff line change @@ -254,4 +254,9 @@ public function testRememberFunctionExistsFromConstructor(): void
254254 ]);
255255 }
256256
257+ public function testBug14384 (): void
258+ {
259+ $ this ->analyse ([__DIR__ . '/data/bug-14384.php ' ], []);
260+ }
261+
257262}
Original file line number Diff line number Diff line change 1+ <?php declare (strict_types = 1 );
2+
3+ namespace Bug14384 ;
4+
5+ $ canCall = function_exists ('some_totally_nonexistent_function_14384 ' );
6+
7+ if ($ canCall ) {
8+ some_totally_nonexistent_function_14384 ();
9+ }
You can’t perform that action at this time.
0 commit comments