public function getFunction(\PhpParser\Node\Name $nameNode, Scope $scope = null) : \PHPStan\Reflection\FunctionReflection
{
$functionName = $this->resolveFunctionName($nameNode, $scope);
if ($functionName === null) {
throw new \PHPStan\Broker\FunctionNotFoundException((string) $nameNode);
}
$lowerCasedFunctionName = strtolower($functionName);
if (!isset($this->functionReflections[$lowerCasedFunctionName])) {
$this->functionReflections[$lowerCasedFunctionName] = $this->functionReflectionFactory->create(new \ReflectionFunction($lowerCasedFunctionName));
}
return $this->functionReflections[$lowerCasedFunctionName];
}