<commit_before><?php

/*
* This file is part of the Integrated package.
*
* (c) e-Active B.V. <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Integrated\Bundle\SolrBundle\DependencyInjection;

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

/**
 * IntegratedContentExtension for loading configuration
 *
 * @author <NAME> <<EMAIL>>
 */
class IntegratedSolrExtension extends Extension
{
    /**
     * Load the configuration
     *
     * @param array $configs
     * @param ContainerBuilder $container
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.xml');

        $configuration = new Configuration;

        $config = $this->processConfiguration($configuration, $configs);

        $directories = array();
        foreach ($config['mapping']['directories'] as $directory) {
            $directories[$directory['namespace_prefix']] = $directory['path'];
        }

        $container
            ->getDefinition('integrated_solr.mapping.file_locator')
            ->replaceArgument(0, $directories)
        ;
    }
}<commit_msg>Use renamed driver and added if statement to check if directories are set<commit_after><?php

/*
* This file is part of the Integrated package.
*
* (c) e-Active B.V. <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Integrated\Bundle\SolrBundle\DependencyInjection;

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

/**
 * IntegratedContentExtension for loading configuration
 *
 * @author <NAME> <<EMAIL>>
 */
class IntegratedSolrExtension extends Extension
{
    /**
     * Load the configuration
     *
     * @param array $configs
     * @param ContainerBuilder $container
     */
    public function load(array $configs, ContainerBuilder $container)
    {
        $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
        $loader->load('services.xml');

        $configuration = new Configuration;

        $config = $this->processConfiguration($configuration, $configs);

        if ((isset($config['mapping']['directories'])) && is_array($config['mapping']['directories'])) {
            $directories = array();
            foreach ($config['mapping']['directories'] as $directory) {
                $directories[$directory['namespace_prefix']] = $directory['path'];
            }

            $container
                ->getDefinition('integrated_solr.mapping.driver.file_locator')
                ->replaceArgument(0, $directories)
            ;
        }
    }
}
{'fraction_non_alphanumeric': 0.12104930467762326, 'fraction_numerical': 0.0006321112515802782, 'mean_word_length': 3.420391061452514, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '7581395', 'n_tokens_mistral': 836, 'n_tokens_neox': 810, 'n_words': 199}