<commit_before><?php
/*
 * This file is part of the Exchange Rate Bundle, an RunOpenCode project.
 *
 * (c) 2016 RunOpenCode
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace RunOpenCode\Bundle\ExchangeRate\DependencyInjection\Factory;

use RunOpenCode\ExchangeRate\Configuration;
use RunOpenCode\ExchangeRate\Registry\RatesConfigurationRegistry;

/**
 * Class RatesConfigurationRegistryFactory
 *
 * Rate configuration builder.
 *
 * @package RunOpenCode\Bundle\ExchangeRate\DependencyInjection\Factory
 */
final class RatesConfigurationRegistryFactory
{
    private function __construct() { }

    /**
     * Build rate configuration from array.
     *
     * @param array $ratesConfigurations
     * @return RatesConfigurationRegistry
     */
    public static function build(array $ratesConfigurations)
    {
        $registry = new RatesConfigurationRegistry();

        foreach ($ratesConfigurations as $ratesConfiguration) {
            $registry->add(new Configuration(
                $ratesConfiguration['currency_code'],
                $ratesConfiguration['rate_type'],
                $ratesConfiguration['source'],
                $ratesConfiguration['alias'],
                $ratesConfiguration['extra']
            ));
        }

        return $registry;
    }<commit_msg>Fixed extension, array configuration bug<commit_after><?php
/*
 * This file is part of the Exchange Rate Bundle, an RunOpenCode project.
 *
 * (c) 2016 RunOpenCode
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace RunOpenCode\Bundle\ExchangeRate\DependencyInjection\Factory;

use RunOpenCode\ExchangeRate\Configuration;
use RunOpenCode\ExchangeRate\Registry\RatesConfigurationRegistry;

/**
 * Class RatesConfigurationRegistryFactory
 *
 * Rate configuration builder.
 *
 * @package RunOpenCode\Bundle\ExchangeRate\DependencyInjection\Factory
 */
final class RatesConfigurationRegistryFactory
{
    private function __construct() { }

    /**
     * Build rate configuration from array.
     *
     * @param array $ratesConfigurations
     * @return RatesConfigurationRegistry
     */
    public static function build(array $ratesConfigurations)
    {
        $registry = new RatesConfigurationRegistry();

        foreach ($ratesConfigurations as $ratesConfiguration) {
            $registry->add(new Configuration(
                $ratesConfiguration['currency_code'],
                $ratesConfiguration['rate_type'],
                $ratesConfiguration['source'],
                $ratesConfiguration['alias'],
                !empty($ratesConfiguration['extra']) ? $ratesConfiguration['extra'] : array()
            ));
        }

        return $registry;
    }
{'fraction_non_alphanumeric': 0.09036568213783404, 'fraction_numerical': 0.0028129395218002813, 'mean_word_length': 3.165446559297218, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4251574', 'n_tokens_mistral': 711, 'n_tokens_neox': 650, 'n_words': 176}