PHPSA\Compiler\Expression\FunctionCall::checkArguments PHP Метод

checkArguments() защищенный Метод

protected checkArguments ( array $arguments, $functionReflection )
$arguments array
    protected function checkArguments(array $arguments, $functionReflection)
    {
        foreach ($arguments as $key => $argument) {
            $parameter = $functionReflection->getParameter($key);
            $paramType = $parameter->getType();
            $argumentType = $argument->getType();
            $numberTypes = [CompiledExpression::INTEGER, CompiledExpression::DOUBLE];
            $callableTypes = [CompiledExpression::STRING, CompiledExpression::ARR];
            // the paramtype is equal to the argument type or mixed
            // or paramtype is number and argumenttype is integer, double
            // or paramtype is callable and argumenttype is string, array
            if (!($paramType == $argumentType || $paramType == CompiledExpression::MIXED) && !($paramType == CompiledExpression::NUMBER && in_array($argumentType, $numberTypes)) && !($paramType == CompiledExpression::CALLABLE_TYPE && in_array($argumentType, $callableTypes))) {
                return false;
            }
        }
        // argumentcount != paramcount
        if (count($arguments) != $functionReflection->getNumberOfRequiredParameters()) {
            return false;
        }
        return true;
    }