ArdentParameterBundle/DependencyInjection/Configuration.php

38 lines
1.2 KiB
PHP
Raw Normal View History

2020-07-26 03:21:34 +02:00
<?php
namespace Ardent\ParameterBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
public const TYPE_TEXT = 'text';
public const TYPE_NUMBER = 'number';
2020-07-26 03:21:34 +02:00
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ardent_parameter');
2020-07-26 03:21:34 +02:00
$treeBuilder->getRootNode()
->children()
->arrayNode('parameters')
->arrayPrototype()
2020-07-27 01:02:18 +02:00
->arrayPrototype()
->children()
->scalarNode('name')->end()
->enumNode('type')
->values([self::TYPE_TEXT, self::TYPE_NUMBER])
->defaultValue(self::TYPE_TEXT)
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
2020-07-26 03:21:34 +02:00
}
}