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}
*/
*/
public function getConfigTreeBuilder(): TreeBuilder {
//Set tree builder
- $treeBuilder = new TreeBuilder('rapsys_user');
+ $treeBuilder = new TreeBuilder(RapsysUserBundle::getAlias());
//The bundle default values
$defaults = [
'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' => [
->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()