<commit_before><?php

/**
 * This file is part of the BazingaGeocoderBundle package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license    MIT License
 */

namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * @author <NAME> <<EMAIL>>
 */
class Configuration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     *
     * @return TreeBuilder The tree builder
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('bazinga_geocoder');

        $rootNode
            ->children()
            ->arrayNode('fake_ip')
                ->beforeNormalization()
                ->ifString()
                    ->then(function($value) { return array('ip' => $value); })
                ->end()
                ->treatFalseLike(array('enabled' => false))
                ->treatTrueLike(array('enabled' => true))
                ->treatNullLike(array('enabled' => true))
                ->children()
                    ->booleanNode('enabled')
                        ->defaultTrue()
                    ->end()
                    ->scalarNode('ip')->defaultNull()->end()
                    ->scalarNode('priority')->defaultValue(0)->end()
                ->end()
            ->end()
            ->arrayNode('adapter')
                ->children()
                    ->scalarNode('class')->defaultNull()->end()
                ->end()
            ->end()
            ->arrayNode('providers')
                ->children()
                ->arrayNode('bing_maps')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                        ->scalarNode('locale')->defaultNull()->end()
                    ->end()
                ->end()
                ->arrayNode('cache')
                    ->children()
                        ->scalarNode('adapter')
                            ->isRequired()
                            ->cannotBeEmpty()
                        ->end()
                        ->scalarNode('provider')
                            ->isRequired()
                            ->cannotBeEmpty()
                        ->end()
                        ->scalarNode('locale')
                            ->defaultNull()
                        ->end()
                        ->scalarNode('lifetime')
                            ->defaultValue(86400)
                            ->validate()
                                ->ifTrue(function($v) { return !is_integer($v); })
                                ->thenInvalid('Only integer are allowed!')
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('ip_info_db')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('yahoo')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                        ->scalarNode('locale')->defaultNull()->end()
                    ->end()
                ->end()
                ->arrayNode('cloudmade')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('google_maps')<commit_msg>Fix cs<commit_after><?php

/**
 * This file is part of the BazingaGeocoderBundle package.
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 *
 * @license    MIT License
 */

namespace Bazinga\Bundle\GeocoderBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;

/**
 * @author <NAME> <<EMAIL>>
 */
class Configuration implements ConfigurationInterface
{
    /**
     * Generates the configuration tree builder.
     *
     * @return TreeBuilder The tree builder
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('bazinga_geocoder');

        $rootNode
            ->children()
            ->arrayNode('fake_ip')
                ->beforeNormalization()
                ->ifString()
                    ->then(function ($value) { return array('ip' => $value); })
                ->end()
                ->treatFalseLike(array('enabled' => false))
                ->treatTrueLike(array('enabled' => true))
                ->treatNullLike(array('enabled' => true))
                ->children()
                    ->booleanNode('enabled')
                        ->defaultTrue()
                    ->end()
                    ->scalarNode('ip')->defaultNull()->end()
                    ->scalarNode('priority')->defaultValue(0)->end()
                ->end()
            ->end()
            ->arrayNode('adapter')
                ->children()
                    ->scalarNode('class')->defaultNull()->end()
                ->end()
            ->end()
            ->arrayNode('providers')
                ->children()
                ->arrayNode('bing_maps')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                        ->scalarNode('locale')->defaultNull()->end()
                    ->end()
                ->end()
                ->arrayNode('cache')
                    ->children()
                        ->scalarNode('adapter')
                            ->isRequired()
                            ->cannotBeEmpty()
                        ->end()
                        ->scalarNode('provider')
                            ->isRequired()
                            ->cannotBeEmpty()
                        ->end()
                        ->scalarNode('locale')
                            ->defaultNull()
                        ->end()
                        ->scalarNode('lifetime')
                            ->defaultValue(86400)
                            ->validate()
                                ->ifTrue(function ($v) { return !is_integer($v); })
                                ->thenInvalid('Only integer are allowed!')
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('ip_info_db')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('yahoo')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                        ->scalarNode('locale')->defaultNull()->end()
                    ->end()
                ->end()
                ->arrayNode('cloudmade')
                    ->children()
                        ->scalarNode('api_key')
                            ->isRequired()->cannotBeEmpty()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('google_maps')
{'fraction_non_alphanumeric': 0.13356810464092567, 'fraction_numerical': 0.0015092441202364483, 'mean_word_length': 1.0244399185336048, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 201, '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': '2632287', 'n_tokens_mistral': 1812, 'n_tokens_neox': 1661, 'n_words': 304}