PHPStan\Analyser\NodeScopeResolver::findParametersInFunctionCall PHP Method

findParametersInFunctionCall() private method

private findParametersInFunctionCall ( PhpParser\Node\Expr $functionCall, Scope $scope ) : null | PHPStan\Reflection\ParameterReflection[]
$functionCall PhpParser\Node\Expr
$scope Scope
return null | PHPStan\Reflection\ParameterReflection[]
    private function findParametersInFunctionCall(Expr $functionCall, Scope $scope)
    {
        if ($functionCall instanceof FuncCall && $functionCall->name instanceof Name) {
            if ($this->broker->hasFunction($functionCall->name, $scope)) {
                return $this->broker->getFunction($functionCall->name, $scope)->getParameters();
            }
        } elseif ($functionCall instanceof MethodCall && is_string($functionCall->name)) {
            $type = $scope->getType($functionCall->var);
            if ($type->getClass() !== null && $this->broker->hasClass($type->getClass())) {
                $classReflection = $this->broker->getClass($type->getClass());
                $methodName = $functionCall->name;
                if ($classReflection->hasMethod((string) $methodName)) {
                    return $classReflection->getMethod((string) $methodName)->getParameters();
                }
            }
        }
        return null;
    }