Bee-Lab/BeelabTagBundle

View on GitHub
src/DependencyInjection/BeelabTagExtension.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
<?php

namespace Beelab\TagBundle\DependencyInjection;

use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

/**
 * This is the class that loads and manages bundle configuration.
 *
 * To learn more see {@link http://symfony.com/doc/current/bundles/extension.html}
 */
final class BeelabTagExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container): void
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);
        $container->setParameter('beelab_tag.tag_class', $config['tag_class']);
        $container->setParameter('beelab_tag.purge', $config['purge']);
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../../config'));
        $loader->load('services.xml');
    }
}