Skip to content
Permalink
Browse files

Fix #2047 - left side of callable is a thing that is also kinda called

  • Loading branch information...
muglug committed Aug 23, 2019
1 parent 0860727 commit 5a1604d088926a05a2901c973209554c28325579
@@ -79,10 +79,17 @@ public static function analyze(
$function_exists = false;
if ($stmt->name instanceof PhpParser\Node\Expr) {
$was_in_call = $context->inside_call;
$context->inside_call = true;
if (ExpressionAnalyzer::analyze($statements_analyzer, $stmt->name, $context) === false) {
return;
}
if (!$was_in_call) {
$context->inside_call = false;
}
if (isset($stmt->name->inferredType)) {
if ($stmt->name->inferredType->isNull()) {
if (IssueBuffer::accepts(
@@ -519,6 +519,15 @@ public function foo() : void {}
new A();'
],
'usedFunctionInCall' => [
'<?php
function fooBar(): void {}
$foo = "foo";
$bar = "bar";
($foo . ucfirst($bar))();',
],
];
}

0 comments on commit 5a1604d

Please sign in to comment.
You can’t perform that action at this time.