ArdentParameterBundle/DependencyInjection/Configuration.php

39 lines
1.2 KiB
PHP
Raw Normal View History

2021-07-21 00:25:37 +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';
2022-01-30 01:11:39 +01:00
public const TYPE_BOOL = 'bool';
2021-07-21 00:25:37 +02:00
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('ardent_parameter');
$treeBuilder->getRootNode()
->children()
->arrayNode('parameters')
->arrayPrototype()
->arrayPrototype()
->children()
->scalarNode('name')->end()
->enumNode('type')
2022-01-30 01:11:39 +01:00
->values([self::TYPE_TEXT, self::TYPE_NUMBER, self::TYPE_BOOL])
2021-07-21 00:25:37 +02:00
->defaultValue(self::TYPE_TEXT)
->end()
->end()
->end()
->end()
->end()
->end();
return $treeBuilder;
}
2020-07-26 03:21:34 +02:00
}