<commit_before><?php

namespace Phobetor\RabbitMqSupervisorBundle\DependencyInjection;

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

/**
 * Fetch the RabbitMq bundle's consumer configuration.
 */
class RabbitMqSupervisorExtension extends Extension implements PrependExtensionInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');

        $container->setParameter('phobetor_rabbitmq_supervisor.paths', $config['paths']);
        $container->setParameter('phobetor_rabbitmq_supervisor.workspace', $config['paths']['workspace']);
        $container->setParameter('phobetor_rabbitmq_supervisor.commands', $config['commands']);
    }

    public function prepend(ContainerBuilder $container)
    {
        foreach ($container->getExtensions() as $name => $extension) {
            switch ($name) {
                case 'old_sound_rabbit_mq':
                    // take over this bundle's configuration
                    $extensionConfig = $container->getExtensionConfig($name);

                    foreach (array('consumers', 'multiple_consumers') as $attribute) {
                        if (isset($extensionConfig[0][$attribute])) {
                            $attributeValue = $extensionConfig[0][$attribute];
                        } else {
                            $attributeValue = array();
                        }
                        $container->setParameter('phobetor_rabbitmq_supervisor.' . $attribute, $attributeValue);
                    }<commit_msg>fix(bundle extension): fix workspace configuration key<commit_after><?php

namespace Phobetor\RabbitMqSupervisorBundle\DependencyInjection;

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

/**
 * Fetch the RabbitMq bundle's consumer configuration.
 */
class RabbitMqSupervisorExtension extends Extension implements PrependExtensionInterface
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.yml');

        $container->setParameter('phobetor_rabbitmq_supervisor.paths', $config['paths']);
        $container->setParameter('phobetor_rabbitmq_supervisor.workspace', $config['paths']['workspace_directory']);
        $container->setParameter('phobetor_rabbitmq_supervisor.commands', $config['commands']);
    }

    public function prepend(ContainerBuilder $container)
    {
        foreach ($container->getExtensions() as $name => $extension) {
            switch ($name) {
                case 'old_sound_rabbit_mq':
                    // take over this bundle's configuration
                    $extensionConfig = $container->getExtensionConfig($name);

                    foreach (array('consumers', 'multiple_consumers') as $attribute) {
                        if (isset($extensionConfig[0][$attribute])) {
                            $attributeValue = $extensionConfig[0][$attribute];
                        } else {
                            $attributeValue = array();
                        }
                        $container->setParameter('phobetor_rabbitmq_supervisor.' . $attribute, $attributeValue);
                    }
{'fraction_non_alphanumeric': 0.1134020618556701, 'fraction_numerical': 0.0009590026372572524, 'mean_word_length': 2.9507575757575757, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2761949', 'n_tokens_mistral': 1049, 'n_tokens_neox': 1001, 'n_words': 175}