open-orchestra/open-orchestra-elastica-bundle

View on GitHub
ElasticaBundle/DependencyInjection/Configuration.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace OpenOrchestra\ElasticaBundle\DependencyInjection;

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

/**
 * 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}
 */
class Configuration implements ConfigurationInterface
{
    /**
     * {@inheritdoc}
     */
    public function getConfigTreeBuilder()
    {
        $treeBuilder = new TreeBuilder();
        $rootNode = $treeBuilder->root('open_orchestra_elastica');

        $rootNode->children()
            ->scalarNode('host')->defaultValue('127.0.0.1')->end()
            ->scalarNode('port')->defaultValue(9200)->end()
            ->scalarNode('index_name')->defaultValue('orchestra')->end()
        ->end();

        return $treeBuilder;
    }
}