<commit_before><?php

namespace Knp\DoctrineBehaviors\Bundle\DependencyInjection;

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

class Configuration implements ConfigurationInterface
{
    public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();
        $builder
            ->root('knp_doctrine_behaviors')
            ->beforeNormalization()
                ->always(function (array $config) {
                    if (empty($config)) {
                        return [
                            'blameable'      => true,
                            'geocodable'     => true,
                            'loggable'       => true,
                            'sluggable'      => true,
                            'soft_deletable' => true,
                            'sortable'       => true,
                            'timestampable'  => true,
                            'translatable'   => true,
                            'tree'           => true,
                        ];
                    }

                    return $config;
                })
            ->end()
            ->children()
                ->booleanNode('blameable')->defaultFalse()->treatNullLike(false)->end()
                ->booleanNode('geocodable')->defaultFalse()->treatNullLike(false)->end()<commit_msg>Fix config deprecation (#411)<commit_after><?php

namespace Knp\DoctrineBehaviors\Bundle\DependencyInjection;

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

class Configuration implements ConfigurationInterface
{
    public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder('knp_doctrine_behaviors');

        if (method_exists($builder, 'getRootNode')) {
            $rootNode = $builder->getRootNode();
        } else {
            // for symfony/config 4.1 and older
            $rootNode = $builder->root('knp_doctrine_behaviors');
        }

        $rootNode
            ->beforeNormalization()
                ->always(function (array $config) {
                    if (empty($config)) {
                        return [
                            'blameable'      => true,
                            'geocodable'     => true,
                            'loggable'       => true,
                            'sluggable'      => true,
                            'soft_deletable' => true,
                            'sortable'       => true,
                            'timestampable'  => true,
                            'translatable'   => true,
                            'tree'           => true,
                        ];
                    }

                    return $config;
                })
            ->end()
            ->children()
                ->booleanNode('blameable')->defaultFalse()->treatNullLike(false)->end()
                ->booleanNode('geocodable')->defaultFalse()->treatNullLike(false)->end()
{'fraction_non_alphanumeric': 0.10939553219448095, 'fraction_numerical': 0.0016425755584756898, 'mean_word_length': 1.2723880597014925, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 48, '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': '247397', 'n_tokens_mistral': 731, 'n_tokens_neox': 702, 'n_words': 114}