public function resolveArguments(Callable $callable, Request $request, Array $route_info)
    {
        $arguments = array();

        // Examine the controller method with reflection and
        // build arguments
        $ref = new \ReflectionMethod($callable[0], $callable[1]);
        $req_attr = $request->query->all();

        foreach ($ref->getParameters() as $parameter) {
            if (array_key_exists($parameter->name, $req_attr)) {
                $arguments[] = $req_attr[$parameter->name];
            } elseif (array_key_exists($parameter->name, $route_info)) {
                $arguments[] = $route_info[$parameter->name];
            } elseif ($parameter->getClass() && $parameter->getClass()->isInstance($request)) {
                $arguments[] = $request;
            } elseif ($parameter->isDefaultValueAvailable()) {
                $arguments[] = $parameter->getDefaultValue();
            } else {
                throw new \RuntimeException(sprintf('Controller %s::%s requires a value for parameter %s.', get_class($callable[0]), $callable[1], $parameter->name));
            }
        }

        return($arguments);
    }