private function invokeObjectMethod($object, $method, $namedParams, $classParams)
    {
        if (!method_exists($object, $method)) {
            $class = get_class($object);
            throw new \InvalidArgumentException("Method $class::$method does not exist.");
        }

        $reflection = new \ReflectionMethod($object, $method);
        $params = $reflection->getParameters();

        $invokeParams = $this->mapParameters($params, $namedParams, $classParams);

        return call_user_func_array([$object, $method], $invokeParams);
    }