summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
89c69fc)
Allow default and class extra keys
Cleanup
//The bundle default values
$defaults = [
'class' => [
//The bundle default values
$defaults = [
'class' => [
- 'group' => 'Rapsys\\UserBundle\\Entity\\Group',
'civility' => 'Rapsys\\UserBundle\\Entity\\Civility',
'civility' => 'Rapsys\\UserBundle\\Entity\\Civility',
+ 'group' => 'Rapsys\\UserBundle\\Entity\\Group',
'user' => 'Rapsys\\UserBundle\\Entity\\User'
],
'default' => [
'user' => 'Rapsys\\UserBundle\\Entity\\User'
],
'default' => [
- 'languages' => [
- 'en_gb' => 'English'
- ],
'contact' => [
'address' => 'contact@example.com',
'name' => 'John Doe'
'contact' => [
'address' => 'contact@example.com',
'name' => 'John Doe'
->addDefaultsIfNotSet()
->children()
->arrayNode('class')
->addDefaultsIfNotSet()
->children()
->arrayNode('class')
- ->treatNullLike([])
- ->defaultValue($defaults['class'])
- ->scalarPrototype()->end()
+ ->addDefaultsIfNotSet()
+ ->ignoreExtraKeys()
+ ->children()
+ ->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['class']['civility'])->end()
+ ->scalarNode('group')->cannotBeEmpty()->defaultValue($defaults['class']['group'])->end()
+ ->scalarNode('user')->cannotBeEmpty()->defaultValue($defaults['class']['user'])->end()
+ ->end()
->end()
->arrayNode('default')
->addDefaultsIfNotSet()
->end()
->arrayNode('default')
->addDefaultsIfNotSet()
->children()
->scalarNode('admin')->cannotBeEmpty()->defaultValue($defaults['default']['admin'])->end()
->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['default']['civility'])->end()
->children()
->scalarNode('admin')->cannotBeEmpty()->defaultValue($defaults['default']['admin'])->end()
->scalarNode('civility')->cannotBeEmpty()->defaultValue($defaults['default']['civility'])->end()
->defaultValue($defaults['translate'])
->scalarPrototype()->end()
->end()
->defaultValue($defaults['translate'])
->scalarPrototype()->end()
->end()
- #TODO: see if we can't prevent key normalisation with ->normalizeKeys(false)
- ->arrayNode('languages')
- ->treatNullLike([])
- ->defaultValue($defaults['languages'])
- ->scalarPrototype()->end()
- ->end()
->arrayNode('contact')
->addDefaultsIfNotSet()
->children()
->arrayNode('contact')
->addDefaultsIfNotSet()
->children()