Skip to content

Commit f994fd9

Browse files
committed
Param check: if user is set, pass must be present (mongo)
1 parent d03ca98 commit f994fd9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

DependencyInjection/Configuration.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ public function getConfigTreeBuilder()
273273
})
274274
->thenInvalid('What must be set is either the host or the id.')
275275
->end()
276+
->validate()
277+
->ifTrue(function($v) {
278+
return isset($v['user']) && !isset($v['pass']);
279+
})
280+
->thenInvalid('If you set user, you must provide a password.')
281+
->end()
276282
->end() // mongo
277283
->arrayNode('members') // group
278284
->canBeUnset()

0 commit comments

Comments
 (0)