X-Git-Url: https://git.rapsys.eu/userbundle/blobdiff_plain/a870c61c5c4f93e315fd8508ad76dc01e74ceb1f..46718ab1a0cb7878556d18db4dffa306e95110cd:/DependencyInjection/Configuration.php diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index b22d973..01d6ee5 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -14,10 +14,12 @@ namespace Rapsys\UserBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; +use Rapsys\UserBundle\RapsysUserBundle; + /** * This is the class that validates and merges configuration from your app/config files. * - * @link http://symfony.com/doc/current/cookbook/bundles/configuration.html} + * @link http://symfony.com/doc/current/cookbook/bundles/configuration.html * * {@inheritdoc} */ @@ -27,7 +29,7 @@ class Configuration implements ConfigurationInterface { */ public function getConfigTreeBuilder(): TreeBuilder { //Set tree builder - $treeBuilder = new TreeBuilder('rapsys_user'); + $treeBuilder = new TreeBuilder(RapsysUserBundle::getAlias()); //The bundle default values $defaults = [ @@ -96,7 +98,7 @@ class Configuration implements ConfigurationInterface { 'route' => ['index' => 'index_url', 'recover' => 'recover_url'], 'view' => [ 'name' => '@RapsysUser/form/recover.html.twig', - 'form' => 'Rapsys\UserBundle\Form\RecoverType', + 'form' => 'Rapsys\UserBundle\Form\LoginType', 'context' => [] ], 'mail' => [ @@ -138,12 +140,9 @@ class Configuration implements ConfigurationInterface { ->addDefaultsIfNotSet() ->children() ->arrayNode('class') - ->addDefaultsIfNotSet() - ->children() - ->scalarNode('group')->cannotBeEmpty()->defaultValue($defaults['class']['group'])->end() - ->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['class']['civility'])->end() - ->scalarNode('user')->cannotBeEmpty()->defaultValue($defaults['class']['user'])->end() - ->end() + ->treatNullLike([]) + ->defaultValue($defaults['class']) + ->scalarPrototype()->end() ->end() ->arrayNode('default') ->addDefaultsIfNotSet()