public function registerAdapter($name, $class)
    {
        if (!is_subclass_of($class, AdapterInterface::class)) {
            throw new \RuntimeException(sprintf(
                'Adapter class "%s" must implement ' . AdapterInterface::class,
                $class
            ));
        }
        $this->adapters[$name] = $class;

        return $this;
    }