public function resolveFunction(
        IContainer $container,
        $functionName,
        array $args = []
    ) {
        $function = new ReflectionFunction($functionName);

        try {
            $arguments = $this->buildArgumentsFromParameters(
                $container, $function->getParameters(), $args
            );
        } catch (UnresolveableArgumentException $ex) {
            $ex->setFunctionName($function->isClosure() ? 'Closure' : $function->getName());

            throw $ex;
        }

        return $function->invokeArgs($arguments);
    }
public function resolveFunction(
        IContainer $container,
        $functionName,
        array $args = []
    ) {
        $function = new ReflectionFunction($functionName);

        try {
            $arguments = $this->buildArgumentsFromParameters(
                $container, $function->getParameters(), $args
            );
        } catch (UnresolveableArgumentException $ex) {
            $ex->setFunctionName($function->isClosure() ? 'Closure' : $function->getName());

            throw $ex;
        }

        return $function->invokeArgs($arguments);
    }
@param IContainer $container
@param $functionName
@param array $args

@return mixed
@throws Exception
@throws UnresolveableArgumentException