<commit_before><?php

/*
* This file is part of the MilioooMessageBundle package.
*
* (c) <NAME> <<EMAIL>>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Miliooo\FriendsBundle\DependencyInjection;

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

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class MilioooFriendsExtension extends Extension
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('command.xml');
        $loader->load('controllers.xml');
        $loader->load('deleter.xml');
        $loader->load('listener.xml');
        $loader->load('services.xml');
        $loader->load('specifications.xml');

        $container->setParameter('miliooo_friends.relationship_class', $config['relationship_class']);
        $container->setAlias('miliooo_friends.relationship_creator', $config['relationship_creator']);
        $container->setAlias('miliooo_friends.logged_in_user_provider', $config['logged_in_user_provider']);
        $container->setAlias('miliooo_friends.user_relationship_transformer', $config['user_relationship_transformer']);
        $this->setDeleterAliases($container, $config);
        $container->setAlias('miliooo_friends.specifications.can_delete_relationship', $config['specifications']['can_delete_relationship']);
        $container->setAlias('miliooo_friends.user_relationships_provider', $config['user_relationships_provider']);
        $container->setAlias('miliooo_friends.twig_extension', $config['twig_extension']);

        $container->setAlias('miliooo_friends.handler.create_relationship', $config['handler']['create_relationship']);
        $container->setAlias('miliooo_friends.handler.delete_relationship', $config['handler']['delete_relationship']);
    }

    /**
     * Sets the deleter aliases.
     *
     * @param ContainerBuilder $container The container instance
     * @param array            $config    The processed config
     */
    protected function setDeleterAliases(ContainerBuilder $container, $config)
    {
        $container->setAlias('miliooo_friends.deleter.relationship_deleter', $config['deleter']['relationship_deleter']);
        $container->setAlias('miliooo_friends.deleter.relationship_deleter_secure_aware', $config['deleter']['relationship_deleter_secure_aware']);
    }
}
<commit_msg>added alias<commit_after><?php

/*
* This file is part of the MilioooMessageBundle package.
*
* (c) <NAME> <<EMAIL>>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Miliooo\FriendsBundle\DependencyInjection;

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

/**
 * This is the class that loads and manages your bundle configuration
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
 */
class MilioooFriendsExtension extends Extension
{
    /**
     * {@inheritDoc}
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $configuration = new Configuration();
        $config = $this->processConfiguration($configuration, $configs);

        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
        $loader->load('command.xml');
        $loader->load('controllers.xml');
        $loader->load('deleter.xml');
        $loader->load('listener.xml');
        $loader->load('services.xml');
        $loader->load('specifications.xml');

        $container->setParameter('miliooo_friends.relationship_class', $config['relationship_class']);
        $container->setAlias('miliooo_friends.relationship_creator', $config['relationship_creator']);
        $container->setAlias('miliooo_friends.logged_in_user_provider', $config['logged_in_user_provider']);
        $container->setAlias('miliooo_friends.user_relationship_transformer', $config['user_relationship_transformer']);
        $this->setDeleterAliases($container, $config);
        $container->setAlias('miliooo_friends.specifications.can_delete_relationship', $config['specifications']['can_delete_relationship']);
        $container->setAlias('miliooo_friends.user_relationships_provider', $config['user_relationships_provider']);
        $container->setAlias('miliooo_friends.twig_extension', $config['twig_extension']);

        $container->setAlias('miliooo_friends.handler.create_relationship', $config['handler']['create_relationship']);
        $container->setAlias('miliooo_friends.handler.delete_relationship', $config['handler']['delete_relationship']);

        $container->setAlias('miliooo_friends.cache_provider', $config['cache_provider']);
    }

    /**
     * Sets the deleter aliases.
     *
     * @param ContainerBuilder $container The container instance
     * @param array            $config    The processed config
     */
    protected function setDeleterAliases(ContainerBuilder $container, $config)
    {
        $container->setAlias('miliooo_friends.deleter.relationship_deleter', $config['deleter']['relationship_deleter']);
        $container->setAlias('miliooo_friends.deleter.relationship_deleter_secure_aware', $config['deleter']['relationship_deleter_secure_aware']);
    }
}

{'fraction_non_alphanumeric': 0.13327759197324415, 'fraction_numerical': 0.0, 'mean_word_length': 4.801163918525703, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 48, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '4938351', 'n_tokens_mistral': 1697, 'n_tokens_neox': 1626, 'n_words': 269}