]> Raphaël G. Git Repositories - userbundle/blobdiff - DependencyInjection/Configuration.php
Rename default controller to user controller
[userbundle] / DependencyInjection / Configuration.php
index 829a1aa4c571a65301ec0d96d8c46020cfa813f6..22c34f09a2ac3e0aca591eb4dc6143ed714fedc6 100644 (file)
@@ -1,7 +1,7 @@
 <?php declare(strict_types=1);
 
 /*
- * This file is part of the Rapsys PackBundle package.
+ * This file is part of the Rapsys UserBundle package.
  *
  * (c) Raphaël Gertz <symfony@rapsys.eu>
  *
@@ -69,16 +69,16 @@ class Configuration implements ConfigurationInterface {
                                ]
                        ],
                        'translate' => [],
-                       'locales' => '%kernel.translator.fallbacks%',
                        'languages' => [
                                'en_gb' => 'English'
                        ],
                        'contact' => [
-                               'title' => 'John Doe',
-                               'mail' => 'contact@example.com'
+                               'address' => 'contact@example.com',
+                               'name' => 'John Doe'
                        ],
                        'context' => [],
                        'edit' => [
+                               'field' => [],
                                'route' => ['index' => 'index_url'],
                                'view' => [
                                        'name' => '@RapsysUser/form/register.html.twig',
@@ -110,6 +110,7 @@ class Configuration implements ConfigurationInterface {
                                ]
                        ],
                        'register' => [
+                               'field' => [],
                                'route' => ['index' => 'index_url', 'confirm' => 'confirm_url'],
                                'view' => [
                                        'name' => '@RapsysUser/form/register.html.twig',
@@ -146,15 +147,9 @@ class Configuration implements ConfigurationInterface {
                                                ->scalarPrototype()->end()
                                        ->end()
                                        ->arrayNode('default')
-                                               ->addDefaultsIfNotSet()
-                                               ->children()
-                                                       ->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['default']['civility'])->end()
-                                                       ->arrayNode('group')
-                                                               ->treatNullLike([])
-                                                               ->defaultValue($defaults['default']['group'])
-                                                               ->scalarPrototype()->end()
-                                                       ->end()
-                                               ->end()
+                                               ->treatNullLike([])
+                                               ->defaultValue($defaults['default'])
+                                               ->variablePrototype()->end()
                                        ->end()
                                        ->arrayNode('route')
                                                ->addDefaultsIfNotSet()
@@ -232,7 +227,7 @@ class Configuration implements ConfigurationInterface {
                                                ->defaultValue($defaults['translate'])
                                                ->scalarPrototype()->end()
                                        ->end()
-                                       ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->end()
+                                       #TODO: see if we can't prevent key normalisation with ->normalizeKeys(false)
                                        ->arrayNode('languages')
                                                ->treatNullLike([])
                                                ->defaultValue($defaults['languages'])
@@ -241,8 +236,8 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('contact')
                                                ->addDefaultsIfNotSet()
                                                ->children()
-                                                       ->scalarNode('title')->cannotBeEmpty()->defaultValue($defaults['contact']['title'])->end()
-                                                       ->scalarNode('mail')->cannotBeEmpty()->defaultValue($defaults['contact']['mail'])->end()
+                                                       ->scalarNode('address')->cannotBeEmpty()->defaultValue($defaults['contact']['address'])->end()
+                                                       ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['contact']['name'])->end()
                                                ->end()
                                        ->end()
                                        ->arrayNode('context')
@@ -253,6 +248,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('edit')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('field')
+                                                               ->treatNullLike([])
+                                                               ->defaultValue($defaults['edit']['field'])
+                                                               ->variablePrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('route')
                                                                ->treatNullLike([])
                                                                ->defaultValue($defaults['edit']['route'])
@@ -333,6 +333,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('register')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('field')
+                                                               ->treatNullLike([])
+                                                               ->defaultValue($defaults['register']['field'])
+                                                               ->variablePrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('route')
                                                                ->treatNullLike([])
                                                                ->defaultValue($defaults['register']['route'])