forked from doctrine/DoctrineMigrationsBundle
/
Configuration.php
33 lines (28 loc) · 1.07 KB
/
Configuration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
namespace Symfony\Bundle\DoctrineMigrationsBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\NodeBuilder;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
/**
* DoctrineMigrationsExtension configuration structure.
*
* @author Lukas Kahwe Smith <smith@pooteeweet.org>
*/
class Configuration
{
/**
* Generates the configuration tree.
*
* @return \Symfony\Component\Config\Definition\NodeInterface
*/
public function getConfigTree()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('doctrine_migrations', 'array');
$rootNode
->scalarNode('dir_name')->defaultValue('%kernel.root_dir%/DoctrineMigrations')->cannotBeEmpty()->end()
->scalarNode('namespace')->defaultValue('Application\Migrations')->cannotBeEmpty()->end()
->scalarNode('table_name')->defaultValue('migration_versions')->cannotBeEmpty()->end()
->scalarNode('name')->defaultValue('Application Migrations')->end();
return $treeBuilder->buildTree();
}
}