<commit_before><?php

/*
 * This file is part of the Nelmio SolariumBundle.
 *
 * (c) Nelmio <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Nelmio\SolariumBundle\DependencyInjection;

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

/**
 * @author <NAME> <<EMAIL>>
 */
class NelmioSolariumExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

        if (!empty($config['adapter'])) {
            $options = array(
                'adapter'           => $config['adapter']['class'],
                'adapteroptions'    => array(
                    'host'  => $config['adapter']['host'],
                    'port'  => $config['adapter']['port'],
                    'path'  => $config['adapter']['path'],
                ),
            );
            foreach (array('core', 'timeout',) as $option) {
                if (isset($config['adapter'][$option])) {
                    $options['adapteroptions'][$option] = $config['adapter'][$option];
                }
            }
            $container->setParameter('solarium.client.options', $options);

            $loader->load('services.yml');
        }
    }
}
<commit_msg>removed unnecessary isset() in extension class (defaults already set)<commit_after><?php

/*
 * This file is part of the Nelmio SolariumBundle.
 *
 * (c) Nelmio <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Nelmio\SolariumBundle\DependencyInjection;

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

/**
 * @author <NAME> <<EMAIL>>
 */
class NelmioSolariumExtension extends Extension
{
    public function load(array $configs, ContainerBuilder $container)
    {
        $processor = new Processor();
        $configuration = new Configuration();
        $config = $processor->processConfiguration($configuration, $configs);
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

        if (!empty($config['adapter'])) {
            $options = array(
                'adapter'           => $config['adapter']['class'],
                'adapteroptions'    => array(
                    'host'      => $config['adapter']['host'],
                    'port'      => $config['adapter']['port'],
                    'path'      => $config['adapter']['path'],
                    'core'      => $config['adapter']['core'],
                    'timeout'   => $config['adapter']['timeout'],
                ),
            );
            $container->setParameter('solarium.client.options', $options);

            $loader->load('services.yml');
        }
    }
}

{'fraction_non_alphanumeric': 0.14156028368794327, 'fraction_numerical': 0.0, 'mean_word_length': 2.650103519668737, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 31, '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': '5004021', 'n_tokens_mistral': 916, 'n_tokens_neox': 898, 'n_words': 195}