private function registerConfig(
        string $driver,
        string $bundle,
        array $bundles,
        array $configs,
        LoaderInterface $loader
    ) {
        /** @var bool|null $isEnabled */
        $isEnabled = $configs['db_drivers'][$driver];
        if (false === $isEnabled) {
            return;
        }

        $bundleIsRegistered = array_key_exists($bundle, $bundles);
        if ($isEnabled && false === $bundleIsRegistered) {
            throw new LogicException(
                sprintf(
                    'Cannot enable "%s" driver as the bundle "%s" is missing',
                    $driver,
                    $bundle
                )
            );
        }

        if ($bundleIsRegistered) {
            $loader->load($driver.'.xml');
        }
    }