private function overrideConfigByRegistry(Config $config, $bundleId, $scopePerContext, $scopePerEnvironment)
    {
        $registry = $this->getRegistryConfig($bundleId, $scopePerContext, $scopePerEnvironment);
        if (null !== $registry) {
            $registryConfig = @unserialize($registry->getValue());
            if (is_array($registryConfig)) {
                foreach ($registryConfig as $section => $value) {
                    $config->setSection($section, $value, true);
                }
            }
        }

        return $this;
    }