Skip to content

Commit

Permalink
[SecurityBundle] Minor fixes in configuration tree builder
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Feb 29, 2020
1 parent 8d2990e commit 1bd779d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Expand Up @@ -139,12 +139,14 @@ public function addConfiguration(NodeDefinition $node)
->end()
->prototype('scalar')->end()
->end()
->scalarNode('catch_exceptions')->defaultTrue()->end()
->booleanNode('catch_exceptions')->defaultTrue()->end()
;

foreach ($this->options as $name => $value) {
if (\is_bool($value)) {
$builder->booleanNode($name)->defaultValue($value);
} elseif (\is_int($value)) {
$builder->integerNode($name)->defaultValue($value);
} else {
$builder->scalarNode($name)->defaultValue($value);
}
Expand Down
Expand Up @@ -47,11 +47,12 @@ public function getKey()
public function addConfiguration(NodeDefinition $node)
{
$node
->fixXmlConfig('default_role')
->children()
->scalarNode('service')->isRequired()->cannotBeEmpty()->defaultValue('ldap')->end()
->scalarNode('base_dn')->isRequired()->cannotBeEmpty()->end()
->scalarNode('search_dn')->end()
->scalarNode('search_password')->end()
->scalarNode('search_dn')->defaultNull()->end()
->scalarNode('search_password')->defaultNull()->end()
->arrayNode('default_roles')
->beforeNormalization()->ifString()->then(function ($v) { return preg_split('/\s*,\s*/', $v); })->end()
->requiresAtLeastOneElement()
Expand Down

0 comments on commit 1bd779d

Please sign in to comment.