<commit_before><?php

namespace Xidea\Bundle\BaseBundle\DependencyInjection;

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

/**
 * This is the class that validates and merges configuration from your app/config files
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
 */
abstract class AbstractConfiguration implements ConfigurationInterface
{
    /*
     * @var string
     */
    protected $alias;
    
    public function __construct($alias)
    {
        $this->alias = $alias;
    }
    
    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root($this->alias);

        return $treeBuilder;
    }
    
    abstract public function getDefaultTemplateNamespace();
    
    public function getDefaultTemplateEngine()
    {
        return 'twig';
    }
    
    protected function addTemplateNode($namespace, $engine, $templates = array())
    {
        $builder = new TreeBuilder();
        $node = $builder->root('template');
        
        $node
            ->addDefaultsIfNotSet()
            ->prototype('array')
                ->children()
                    ->scalarNode('configuration')->isRequired()->cannotBeEmpty()->end()
                    ->scalarNode('namespace')->defaultValue($namespace)->end()
                    ->scalarNode('engine')->defaultValue($engine)->end()
                    ->arrayNode('templates')
                        ->useAttributeAsKey('name')
                        ->prototype('array')
                            ->children()
                                ->scalarNode('path')->end()
                            ->end()
                        ->end()
                        ->defaultValue($templates)
                    ->end()
                ->end()
            ->end()
        ;
        
        return $node;
    }
}<commit_msg>Fixed the addTemplateNode method :)<commit_after><?php

namespace Xidea\Bundle\BaseBundle\DependencyInjection;

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

/**
 * This is the class that validates and merges configuration from your app/config files
 *
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
 */
abstract class AbstractConfiguration implements ConfigurationInterface
{
    /*
     * @var string
     */
    protected $alias;
    
    public function __construct($alias)
    {
        $this->alias = $alias;
    }
    
    /**
     * {@inheritDoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root($this->alias);

        return $treeBuilder;
    }
    
    abstract public function getDefaultTemplateNamespace();
    
    public function getDefaultTemplateEngine()
    {
        return 'twig';
    }
    
    protected function addTemplateNode($namespace, $engine, $templates = array())
    {
        $builder = new TreeBuilder();
        $node = $builder->root('template');
        
        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('configuration')->isRequired()->cannotBeEmpty()->end()
                ->scalarNode('namespace')->defaultValue($namespace)->end()
                ->scalarNode('engine')->defaultValue($engine)->end()
                ->arrayNode('templates')
                    ->useAttributeAsKey('name')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('path')->end()
                        ->end()
                    ->end()
                    ->defaultValue($templates)
                ->end()
            ->end()
        ;
        
        return $node;
    }
}
{'fraction_non_alphanumeric': 0.12533013205282112, 'fraction_numerical': 0.0, 'mean_word_length': 1.895066018068103, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '6977482', 'n_tokens_mistral': 1028, 'n_tokens_neox': 999, 'n_words': 184}