/**
* @param \PhpParser\Node\Expr\FuncCall $node
* @param \PHPStan\Analyser\Scope $scope
* @return string[]
*/
public function processNode(Node $node, Scope $scope) : array
{
if (!$node->name instanceof \PhpParser\Node\Name) {
return [];
}
if (!$this->broker->hasFunction($node->name, $scope)) {
return [sprintf('Function %s not found.', (string) $node->name)];
}
$function = $this->broker->getFunction($node->name, $scope);
$name = (string) $node->name;
if ($function->getName() !== $this->broker->resolveFunctionName($node->name, $scope)) {
return [sprintf('Call to function %s() with incorrect case: %s', $function->getName(), $name)];
}
return [];
}