]> Raphaël G. Git Repositories - userbundle/blobdiff - DependencyInjection/Configuration.php
Add note about normalisation prevention
[userbundle] / DependencyInjection / Configuration.php
index 01d6ee5c771cb1b55ebf36b5f48dc330ef526788..1dc51669a73fef32915335b81eb57f6977e06e31 100644 (file)
@@ -1,7 +1,7 @@
 <?php declare(strict_types=1);
 
 /*
 <?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>
  *
  *
  * (c) Raphaël Gertz <symfony@rapsys.eu>
  *
@@ -79,10 +79,12 @@ class Configuration implements ConfigurationInterface {
                        ],
                        'context' => [],
                        'edit' => [
                        ],
                        'context' => [],
                        'edit' => [
+                               'field' => [],
                                'route' => ['index' => 'index_url'],
                                'view' => [
                                'route' => ['index' => 'index_url'],
                                'view' => [
-                                       'form' => 'Rapsys\UserBundle\Form\RegisterType',
                                        'name' => '@RapsysUser/form/register.html.twig',
                                        'name' => '@RapsysUser/form/register.html.twig',
+                                       'edit' => 'Rapsys\UserBundle\Form\RegisterType',
+                                       'reset' => 'Rapsys\UserBundle\Form\LoginType',
                                        'context' => []
                                ]
                        ],
                                        'context' => []
                                ]
                        ],
@@ -109,10 +111,11 @@ class Configuration implements ConfigurationInterface {
                                ]
                        ],
                        'register' => [
                                ]
                        ],
                        'register' => [
+                               'field' => [],
                                'route' => ['index' => 'index_url', 'confirm' => 'confirm_url'],
                                'view' => [
                                'route' => ['index' => 'index_url', 'confirm' => 'confirm_url'],
                                'view' => [
-                                       'form' => 'Rapsys\UserBundle\Form\RegisterType',
                                        'name' => '@RapsysUser/form/register.html.twig',
                                        'name' => '@RapsysUser/form/register.html.twig',
+                                       'form' => 'Rapsys\UserBundle\Form\RegisterType',
                                        'context' => []
                                ],
                                'mail' => [
                                        'context' => []
                                ],
                                'mail' => [
@@ -145,15 +148,9 @@ class Configuration implements ConfigurationInterface {
                                                ->scalarPrototype()->end()
                                        ->end()
                                        ->arrayNode('default')
                                                ->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()
                                        ->end()
                                        ->arrayNode('route')
                                                ->addDefaultsIfNotSet()
@@ -231,7 +228,9 @@ class Configuration implements ConfigurationInterface {
                                                ->defaultValue($defaults['translate'])
                                                ->scalarPrototype()->end()
                                        ->end()
                                                ->defaultValue($defaults['translate'])
                                                ->scalarPrototype()->end()
                                        ->end()
+                                       #TODO: see if we can't prevent key normalisation with ->normalizeKeys(false)
                                        ->scalarNode('locales')->cannotBeEmpty()->defaultValue($defaults['locales'])->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'])
                                        ->arrayNode('languages')
                                                ->treatNullLike([])
                                                ->defaultValue($defaults['languages'])
@@ -252,6 +251,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('edit')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('edit')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('field')
+                                                               ->treatNullLike([])
+                                                               ->defaultValue($defaults['edit']['field'])
+                                                               ->variablePrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('route')
                                                                ->treatNullLike([])
                                                                ->defaultValue($defaults['edit']['route'])
                                                        ->arrayNode('route')
                                                                ->treatNullLike([])
                                                                ->defaultValue($defaults['edit']['route'])
@@ -260,7 +264,8 @@ class Configuration implements ConfigurationInterface {
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
                                                        ->arrayNode('view')
                                                                ->addDefaultsIfNotSet()
                                                                ->children()
-                                                                       ->scalarNode('form')->cannotBeEmpty()->defaultValue($defaults['edit']['view']['form'])->end()
+                                                                       ->scalarNode('edit')->cannotBeEmpty()->defaultValue($defaults['edit']['view']['edit'])->end()
+                                                                       ->scalarNode('reset')->cannotBeEmpty()->defaultValue($defaults['edit']['view']['reset'])->end()
                                                                        ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['edit']['view']['name'])->end()
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike([])
                                                                        ->scalarNode('name')->cannotBeEmpty()->defaultValue($defaults['edit']['view']['name'])->end()
                                                                        ->arrayNode('context')
                                                                                ->treatNullLike([])
@@ -331,6 +336,11 @@ class Configuration implements ConfigurationInterface {
                                        ->arrayNode('register')
                                                ->addDefaultsIfNotSet()
                                                ->children()
                                        ->arrayNode('register')
                                                ->addDefaultsIfNotSet()
                                                ->children()
+                                                       ->arrayNode('field')
+                                                               ->treatNullLike([])
+                                                               ->defaultValue($defaults['register']['field'])
+                                                               ->variablePrototype()->end()
+                                                       ->end()
                                                        ->arrayNode('route')
                                                                ->treatNullLike([])
                                                                ->defaultValue($defaults['register']['route'])
                                                        ->arrayNode('route')
                                                                ->treatNullLike([])
                                                                ->defaultValue($defaults['register']['route'])