for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace A2lix\AutoFormBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* @author David ALLIX
* @author Gonzalo Vilaseca <[email protected]>
*/
class Configuration implements ConfigurationInterface
{
* {@inheritdoc}
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('a2lix_auto_form');
$rootNode
->children()
->scalarNode('locale_provider')->defaultValue('default')->end()
->scalarNode('default_locale')->defaultNull()->end()
->arrayNode('locales')
->beforeNormalization()
->ifString()
->then(function ($v) { return preg_split('/\s*,\s*/', $v); })
->end()
->requiresAtLeastOneElement()
->prototype('scalar')->end()
->arrayNode('required_locales')
->scalarNode('templating')->defaultValue('A2lixAutoFormBundle::default.html.twig')->end()
;
return $treeBuilder;
}