Skip to content

Commit

Permalink
bug #35910 [SecurityBundle] Minor fixes in configuration tree builder…
Browse files Browse the repository at this point in the history
… (HeahDude)

This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] Minor fixes in configuration tree builder

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

1bd779d [SecurityBundle] Minor fixes in configuration tree builder
  • Loading branch information
chalasr committed Mar 2, 2020
2 parents e0d1e34 + 1bd779d commit dcf3da8
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 dcf3da8

Please sign in to comment.