protected function fixConfiguration(array $config)
    {
        foreach ($config['sitemap']['doctrine_orm'] as $pos => $sitemap) {
            $sitemap['group'] = $sitemap['group'] ?? false;
            $sitemap['types'] = $sitemap['types'] ?? [];
            $sitemap['connection'] = $sitemap['connection'] ?? 'doctrine.dbal.default_connection';
            $sitemap['route'] = $sitemap['route'] ?? false;
            $sitemap['parameters'] = $sitemap['parameters'] ?? false;
            $sitemap['query'] = $sitemap['query'] ?? false;

            if (false === $sitemap['route']) {
                throw new \RuntimeException('Route cannot be empty, please review the sonata_seo.sitemap configuration');
            }

            if (false === $sitemap['query']) {
                throw new \RuntimeException('Query cannot be empty, please review the sonata_seo.sitemap configuration');
            }

            if (false === $sitemap['parameters']) {
                throw new \RuntimeException('Route\'s parameters cannot be empty, please review the sonata_seo.sitemap configuration');
            }

            $config['sitemap']['doctrine_orm'][$pos] = $sitemap;
        }

        foreach ($config['sitemap']['services'] as $pos => $sitemap) {
            if (!\is_array($sitemap)) {
                $sitemap = [
                    'group' => false,
                    'types' => [],
                    'id' => $sitemap,
                ];
            } else {
                $sitemap['group'] = $sitemap['group'] ?? false;
                $sitemap['types'] = $sitemap['types'] ?? [];

                if (!isset($sitemap['id'])) {
                    throw new \RuntimeException('Service id must to be defined, please review the sonata_seo.sitemap configuration');
                }
            }

            $config['sitemap']['services'][$pos] = $sitemap;
        }

        return $config;
    }
protected function fixConfiguration(array $config)
    {
        foreach ($config['sitemap']['doctrine_orm'] as $pos => $sitemap) {
            $sitemap['group'] = $sitemap['group'] ?? false;
            $sitemap['types'] = $sitemap['types'] ?? [];
            $sitemap['connection'] = $sitemap['connection'] ?? 'doctrine.dbal.default_connection';
            $sitemap['route'] = $sitemap['route'] ?? false;
            $sitemap['parameters'] = $sitemap['parameters'] ?? false;
            $sitemap['query'] = $sitemap['query'] ?? false;

            if (false === $sitemap['route']) {
                throw new \RuntimeException('Route cannot be empty, please review the sonata_seo.sitemap configuration');
            }

            if (false === $sitemap['query']) {
                throw new \RuntimeException('Query cannot be empty, please review the sonata_seo.sitemap configuration');
            }

            if (false === $sitemap['parameters']) {
                throw new \RuntimeException('Route\'s parameters cannot be empty, please review the sonata_seo.sitemap configuration');
            }

            $config['sitemap']['doctrine_orm'][$pos] = $sitemap;
        }

        foreach ($config['sitemap']['services'] as $pos => $sitemap) {
            if (!\is_array($sitemap)) {
                $sitemap = [
                    'group' => false,
                    'types' => [],
                    'id' => $sitemap,
                ];
            } else {
                $sitemap['group'] = $sitemap['group'] ?? false;
                $sitemap['types'] = $sitemap['types'] ?? [];

                if (!isset($sitemap['id'])) {
                    throw new \RuntimeException('Service id must to be defined, please review the sonata_seo.sitemap configuration');
                }
            }

            $config['sitemap']['services'][$pos] = $sitemap;
        }

        return $config;
    }
protected function fixConfiguration ( array $ config ) { foreach ( $ config [ 'sitemap' ] [ 'doctrine_orm' ] as $ pos => $ sitemap ) { $ sitemap [ 'group' ] = $ sitemap [ 'group' ] ?? false ; $ sitemap [ 'types' ] = $ sitemap [ 'types' ] ?? [ ] ; $ sitemap [ 'connection' ] = $ sitemap [ 'connection' ] ?? 'doctrine.dbal.default_connection' ; $ sitemap [ 'route' ] = $ sitemap [ 'route' ] ?? false ; $ sitemap [ 'parameters' ] = $ sitemap [ 'parameters' ] ?? false ; $ sitemap [ 'query' ] = $ sitemap [ 'query' ] ?? false ; if ( false === $ sitemap [ 'route' ] ) { throw new \ RuntimeException ( 'Route cannot be empty, please review the sonata_seo.sitemap configuration' ) ; } if ( false === $ sitemap [ 'query' ] ) { throw new \ RuntimeException ( 'Query cannot be empty, please review the sonata_seo.sitemap configuration' ) ; } if ( false === $ sitemap [ 'parameters' ] ) { throw new \ RuntimeException ( 'Route\'s parameters cannot be empty, please review the sonata_seo.sitemap configuration' ) ; } $ config [ 'sitemap' ] [ 'doctrine_orm' ] [ $ pos ] = $ sitemap ; } foreach ( $ config [ 'sitemap' ] [ 'services' ] as $ pos => $ sitemap ) { if ( ! \ is_array ( $ sitemap ) ) { $ sitemap = [ 'group' => false , 'types' => [ ] , 'id' => $ sitemap , ] ; } else { $ sitemap [ 'group' ] = $ sitemap [ 'group' ] ?? false ; $ sitemap [ 'types' ] = $ sitemap [ 'types' ] ?? [ ] ; if ( ! isset ( $ sitemap [ 'id' ] ) ) { throw new \ RuntimeException ( 'Service id must to be defined, please review the sonata_seo.sitemap configuration' ) ; } } $ config [ 'sitemap' ] [ 'services' ] [ $ pos ] = $ sitemap ; } return $ config ; }
Fix the sitemap configuration.

@param array $config

@return array
Fix the sitemap configuration .