for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* (c) Kévin Dunglas <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Dunglas\ActionBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
use Symfony\Component\Console\Command\Command;
/**
* {@inheritdoc}
* @author Kévin Dunglas <[email protected]>
class Configuration implements ConfigurationInterface
{
public function getConfigTreeBuilder()
$treeBuilder = new TreeBuilder();
$treeBuilder->root('dunglas_action')
->children()
->arrayNode('autodiscover')
->info('Autodiscover action classes stored in the configured directory of bundles and register them as service.')
->canBeDisabled()
->arrayNode('directories')
->info('The directory name to autodiscover in bundles.')
->prototype('array')
->prototype('scalar')->end()
->end()
->defaultValue(call_user_func(function () {
$defaultValue = ['action' => ['Action']];
if (class_exists(Command::class)) {
$defaultValue['command'] = ['Command'];
}
return $defaultValue;
}))
->info('List of directories relative to the kernel root directory containing classes.')
->defaultValue([])
->end();
return $treeBuilder;