Build redis node configuration definition

@return \Symfony\Component\Config\Definition\Builder\TreeBuilder
486281
private function addRedisNode()
    {
        $builder = new TreeBuilder('redis');
        $node    = $this->getRootNode($builder, 'redis');

        $node
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('connection_id')->defaultNull()->end()
                ->scalarNode('host')->defaultValue('%doctrine_cache.redis.host%')->end()
                ->scalarNode('port')->defaultValue('%doctrine_cache.redis.port%')->end()
                ->scalarNode('password')->defaultNull()->end()
                ->scalarNode('timeout')->defaultNull()->end()
                ->scalarNode('database')->defaultNull()->end()
                ->booleanNode('persistent')->defaultFalse()->end()
            ->end()
        ;

        return $node;
    }
706162
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('sphinx_search');

        $this->addIndexerSection($rootNode);
        $this->addIndexesSection($rootNode);
        $this->addSearchdSection($rootNode);

        return $treeBuilder;
    }
1311197
public function getConfigTree()
    {
        $treeBuilder = new TreeBuilder();
        $treeBuilder->root('sixdays_opcache', 'array')
            ->isRequired()
            ->children()
                ->scalarNode('base_url')->isRequired()->end()
                ->scalarNode('web_dir')->isRequired()->end()
            ->end()
        ->end();

        return $treeBuilder->buildTree();
    }
1204389
public function getConfigTreeBuilder()
  {
    $treeBuilder = new TreeBuilder();
    $rootNode    = $treeBuilder->root('enm_transformer');

    $rootNode
        ->useAttributeAsKey('name')
        ->prototype('array')
          ->children()
            ->append($this->addEventConfiguration())
          ->end()
        ->end()
      ->end();

    return $treeBuilder;
  }
644024
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('vespolina_commerce');
        $rootNode
            ->children()
                ->scalarNode('db_driver')->cannotBeOverwritten()->isRequired()->cannotBeEmpty()->end()
            ->end()
        ;

        $this->addIdentifierSetSection($rootNode);
        $this->addOptionGroupSection($rootNode);
        $this->addConfiguredOptionGroupSection($rootNode);
        $this->addOptionSection($rootNode);
        $this->addOrderManagerSection($rootNode);
        $this->addOrderSection($rootNode);
        $this->addProductManagerSection($rootNode);
        $this->addProductSection($rootNode);
        $this->addAttributeSection($rootNode);
        $this->addMerchandiseSection($rootNode);
        $this->addPartnerSection($rootNode);
        $this->addFulfillmentMethodsSection($rootNode);
        $this->addPaymentGateways($rootNode);

        return $treeBuilder;
    }
33401
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('lexik_translation');

        $storages = array(
            StorageInterface::STORAGE_ORM,
            StorageInterface::STORAGE_MONGODB,
            StorageInterface::STORAGE_PROPEL,
        );
        $registrationTypes = array('all', 'files', 'database');
        $inputTypes = array('text', 'textarea');

        $rootNode
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('base_layout')
                    ->cannotBeEmpty()
                    ->defaultValue('@LexikTranslationBundle/layout.html.twig')
                ->end()

                ->arrayNode('fallback_locale')
                    ->isRequired()
                    ->requiresAtLeastOneElement()
                    ->prototype('scalar')->end()
                    ->beforeNormalization()
                        ->ifString()
                        ->then(function ($value) { return array($value); })
                    ->end()
                ->end()

                ->arrayNode('managed_locales')
                    ->isRequired()
                    ->requiresAtLeastOneElement()
                    ->prototype('scalar')->end()
                ->end()

                ->scalarNode('grid_input_type')
                    ->cannotBeEmpty()
                    ->defaultValue('text')
                    ->validate()
                        ->ifNotInArray($inputTypes)
                        ->thenInvalid('The input type "%s" is not supported. Please use one of the following types: '.implode(', ', $inputTypes))
                    ->end()
                ->end()

                ->booleanNode('grid_toggle_similar')
                    ->defaultValue(false)
                ->end()

                ->booleanNode('auto_cache_clean')
                    ->defaultValue(false)
                ->end()

                ->integerNode('auto_cache_clean_interval')
                    ->defaultValue(null)
                ->end()

                ->arrayNode('storage')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('type')
                            ->cannotBeEmpty()
                            ->defaultValue(StorageInterface::STORAGE_ORM)
                            ->validate()
                                ->ifNotInArray($storages)
                                ->thenInvalid('The storage "%s" is not supported. Please use one of the following storage: '.implode(', ', $storages))
                            ->end()
                        ->end()
                        ->scalarNode('object_manager')
                        ->end()
                    ->end()
                ->end()

                ->arrayNode('resources_registration')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->scalarNode('type')
                            ->cannotBeEmpty()
                            ->defaultValue('all')
                            ->validate()
                                ->ifNotInArray($registrationTypes)
                                ->thenInvalid('Invalid registration type "%s". Please use one of the following types: '.implode(', ', $registrationTypes))
                            ->end()
                        ->end()
                        ->booleanNode('managed_locales_only')
                            ->defaultTrue()
                        ->end()
                    ->end()
                ->end()

                ->arrayNode('exporter')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('json_hierarchical_format')
                            ->defaultFalse()
                        ->end()
                        ->booleanNode('use_yml_tree')
                            ->defaultFalse()
                        ->end()
                    ->end()
                ->end()

                ->arrayNode('dev_tools')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('enable')
                            ->defaultFalse()
                        ->end()
                        ->booleanNode('create_missing')
                            ->defaultFalse()
                        ->end()
                        ->scalarNode('file_format')
                            ->defaultValue('yml')
                        ->end()
                    ->end()
                ->end()

            ->end()
        ;

        return $treeBuilder;
    }
1288630
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('openclassrooms_cache');
        $rootNode
            ->children()
                ->arrayNode('provider')
                ->performNoDeepMerging()
                ->beforeNormalization()
                    ->ifString()
                    ->then(function($v) { return array($v => array()); })
                ->end()
                    ->children()
                        ->append($this->addArrayNode())
                        ->append($this->addRedisNode())
                    ->end()
                ->end()
            ->end()
            ->children()
                ->scalarNode('default_lifetime')
                    ->defaultValue(0)
                ->end()
            ->end();

        return $treeBuilder;
    }
1302828
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('o_auth2_server');

        $nodes = $rootNode->children();

        $authorizationCodesNode = $nodes->arrayNode('authorization_codes');
        $accessTokensNode = $nodes->arrayNode('access_tokens');
        $refreshTokensNode = $nodes->arrayNode('refresh_tokens');
        $wwwRealmNode = $nodes->scalarNode('www_realm');
        $userProviderNode = $nodes->scalarNode('user_provider');
        $grantTypesNode = $nodes->arrayNode('grant_types');
        $classesNode = $nodes->arrayNode('classes');
        $storageNode = $nodes->arrayNode('storage');

        $authorizationCodesNode
            ->addDefaultsIfNotSet()
            ->children()
                ->integerNode('lifetime')
                    ->defaultValue(60);

        $classesNode
            ->addDefaultsIfNotSet()
            ->children()
                ->scalarNode('token_type')
                    ->isRequired()
                    ->cannotBeEmpty()
                    ->defaultValue('OAuth2\\TokenType\\Bearer')
                ->end()
            ->end();

        $wwwRealmNode
            ->cannotBeEmpty()
            ->defaultValue('OAuth2Server')
            ->validate()
                ->always(
                    function($value) {
                        $type = gettype($value);

                        if (!is_string($value)) {
                            throw new InvalidTypeException(
                                "oauth2_server.www_realm has to be string, '$type'' given."
                            );
                        }

                        return $value;
                    }
                );

        $userProviderNode
            ->isRequired()
            ->cannotBeEmpty()
            ->validate()
                ->always(
                    function($value) {
                        $type = gettype($value);

                        if (!is_string($value)) {
                            throw new InvalidTypeException(
                                "oauth2_server.user_provider has to be string, '$type' given."
                            );
                        }

                        return $value;
                    }
                );

        $accessTokensNode
            ->addDefaultsIfNotSet()
            ->children()
                ->integerNode('lifetime')
                    ->isRequired()
                    ->defaultValue(1209600)
                ->end()
            ->end();

        $refreshTokensNode
            ->addDefaultsIfNotSet()
            ->children()
                ->booleanNode('generate')
                    ->isRequired()
                    ->defaultTrue()
                ->end()
                ->integerNode('lifetime')
                    ->defaultValue(2678400)
                ->end()
            ->end();

        $grantTypesNode
            ->addDefaultsIfNotSet()
            ->cannotBeEmpty()
            ->children()
                ->booleanNode('authorization_code')
                    ->defaultFalse()
                ->end()
                ->booleanNode('client_credentials')
                    ->defaultFalse()
                ->end()
                ->booleanNode('implicit')
                    ->defaultFalse()
                ->end()
                ->booleanNode('refresh_token')
                    ->defaultFalse()
                ->end()
                ->booleanNode('resource_owner_password_credentials')
                    ->defaultFalse()
                ->end()
            ->end();

        $storageNode
            ->isRequired()
            ->ignoreExtraKeys()
            ->children()
                ->scalarNode('access_token')
                    ->isRequired()
                    ->cannotBeEmpty()
                ->end()
                ->scalarNode('authorization_code')->end()
                ->scalarNode('client')
                    ->isRequired()
                    ->cannotBeEmpty()
                ->end()
                ->scalarNode('refresh_token')->end()
            ->end();

        return $treeBuilder;
    }
1366683
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('doctrine_riak');

        $this->addDocumentManagersSection($rootNode);
        $this->addConnectionsSection($rootNode);
        $this->addResolveTargetDocumentsSection($rootNode);

        $rootNode
            ->children()
                ->scalarNode('proxy_namespace')->defaultValue('RiakODMProxies')->end()
                ->scalarNode('proxy_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/riak/Proxies')->end()
                ->scalarNode('auto_generate_proxy_classes')->defaultValue(false)->end()
                ->scalarNode('hydrator_namespace')->defaultValue('Hydrators')->end()
                ->scalarNode('hydrator_dir')->defaultValue('%kernel.cache_dir%/doctrine/odm/riak/Hydrators')->end()
                ->scalarNode('auto_generate_hydrator_classes')->defaultValue(false)->end()
                ->scalarNode('default_document_manager')->end()
                ->scalarNode('default_connection')->end()
                ->scalarNode('default_database')->defaultValue('default')->end()
                ->arrayNode('default_commit_options')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->booleanNode('j')->end()
                        ->scalarNode('timeout')->end()
                        ->scalarNode('w')->end()
                        ->scalarNode('wtimeout')->end()
                        // Deprecated options
                        ->booleanNode('fsync')->info('Deprecated. Please use the "j" option instead.')->end()
                        ->scalarNode('safe')->info('Deprecated. Please use the "w" option instead.')->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $treeBuilder;
    }
834267
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('gearman');

        $rootNode
            ->children()
                ->arrayNode('bundles')
                    ->prototype('array')
                        ->children()
                            ->scalarNode('name')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->booleanNode('active')
                                ->defaultFalse()
                            ->end()
                            ->arrayNode('include')
                                ->prototype('scalar')->end()
                            ->end()
                            ->arrayNode('ignore')
                                ->prototype('scalar')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('resources')
                    ->scalarPrototype()->end()
                ->end()
                ->arrayNode('servers')
                    ->performNoDeepMerging()
                    ->defaultValue(array(
                        'localhost' =>  array(
                            'host'  =>  '127.0.0.1',
                            'port'  =>  '4730',
                        ),
                    ))
                    ->prototype('array')
                        ->children()
                            ->scalarNode('host')
                                ->isRequired()
                                ->cannotBeEmpty()
                            ->end()
                            ->integerNode('port')
                                ->defaultValue('4730')
                            ->end()
                        ->end()
                    ->end()
                ->end()
                ->arrayNode('defaults')
                    ->addDefaultsIfNotSet()
                    ->children()
                        ->integerNode('iterations')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                        ->scalarNode('method')
                            ->defaultValue('doNormal')
                        ->end()
                        ->booleanNode('callbacks')
                            ->defaultTrue()
                        ->end()
                        ->scalarNode('job_prefix')
                            ->defaultNull()
                        ->end()
                        ->booleanNode('generate_unique_key')
                            ->defaultTrue()
                        ->end()
                        ->booleanNode('workers_name_prepend_namespace')
                            ->defaultTrue()
                        ->end()
                        ->integerNode('minimum_execution_time')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                        ->integerNode('timeout')
                            ->min(0)
                            ->defaultValue(0)
                        ->end()
                    ->end()
                ->end()
            ->end();

        return $treeBuilder;
    }
436018
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode    = $treeBuilder->root('cache');

        $rootNode->children()
            ->append($this->addSessionSupportSection())
            ->append($this->addDoctrineSection())
            ->append($this->addRouterSection())
            ->append($this->addAnnotationSection())
            ->append($this->addSerializerSection())
            ->append($this->addValidationSection())
            ->append($this->addLoggingSection())
            ->append($this->addDataCollectorSection())
            ->end();

        return $treeBuilder;
    }
867517
public function getConfigTreeBuilder()
    {
        return (new TreeBuilder())
            ->root('anime_db_shikimori_browser')
                ->children()
                    ->scalarNode('host')
                        ->cannotBeEmpty()
                        ->defaultValue('https://shikimori.org')
                    ->end()
                    ->scalarNode('prefix')
                        ->cannotBeEmpty()
                        ->defaultValue('/api/')
                    ->end()
                    ->scalarNode('client')
                        ->cannotBeEmpty()
                        ->isRequired()
                    ->end()
                ->end()
            ->end()
        ;
    }
332925
public function getConfigTreeBuilder(): TreeBuilder
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root($this->root);

        $rootNode
            ->children()
            ->scalarNode('admin_class')->defaultValue(Admin::class)->end()
            ->scalarNode('action_class')->defaultValue(Action::class)->end()
            ->scalarNode('fallback_template_directory')->defaultNull()->end()
            ->append($this->getAdminConfigTreeBuilder())
            ->end();

        return $treeBuilder;
    }
283828
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $root = $treeBuilder->root('chameleon_system_sanity_check');

        $root
            ->canBeDisabled()
            ->children()
                ->append($this->getOutputConfiguration())
            ->end();

        return $treeBuilder;
    }
1291957
public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('open_orchestra_front');

        $rootNode->children()
            ->arrayNode('devices')
                ->useAttributeAsKey('name')
                ->prototype('array')
                    ->children()
                        ->scalarNode('parent')->defaultNull()->end()
                    ->end()
                ->end()
            ->end()
            ->append($this->addTemplateSetConfiguration())
            ->scalarNode('device_type_field')->defaultValue('x-ua-device')->end()
        ->end();

        return $treeBuilder;
    }
1349291
public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();

        $node = $builder->root('rocketeer')->children();
        foreach ($this->definitions as $definition) {
            /** @var AbstractDefinition $definition */
            $definition = new $definition();
            $definition->setValues($this->values);
            $definition = $definition->getConfigTreeBuilder();

            $node = $node->append($definition);
        }
        $node = $node->end();

        return $builder;
    }
203894
public function getConfigTreeBuilder()
    {
        $builder = new TreeBuilder();
        $twig    = $builder->root('twig');
        {
            $twig->children()->scalarNode('template_dir');
            $twig->children()->scalarNode('cache_dir')->defaultValue(null);
            $twig->children()->scalarNode('asset_base')->defaultValue('');
            $twig->children()->variableNode('globals')->defaultValue([]);
        }

        return $builder;
    }