public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$treeBuilder->root('dunglas_action')->fixXmlConfig('directory', 'directories')->children()->arrayNode('directories')->info('List of directories relative to the kernel root directory containing classes.')->prototype('scalar')->end()->defaultValue(['../src/*Bundle/{Controller,Action,Command,EventSubscriber}'])->end()->arrayNode('tags')->info('List of tags to add when implementing the corresponding class.')->useAttributeAsKey('class')->prototype('array')->beforeNormalization()->ifString()->then(function ($v) {
return [$v];
})->end()->prototype('array')->beforeNormalization()->ifString()->then(function ($v) {
return [$v, []];
})->end()->validate()->ifTrue(function ($v) {
return count($v) !== 2 || !is_string($v[0]) || !is_array($v[1]);
})->thenInvalid('Invalid tag format. They must be as following: [\'my_tag.name\', [\'attribute\' => \'value\']]')->end()->prototype('variable')->end()->end()->end()->defaultValue([Command::class => [['console.command', []]], EventSubscriberInterface::class => [['kernel.event_subscriber', []]]])->end()->end()->end();
return $treeBuilder;
}