Skip to content

Commit d07bd93

Browse files
authored
fix: don't add multiple rules to a single validate() call (#62)
1 parent 2e0c714 commit d07bd93

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,16 @@ public function getConfigTreeBuilder(): TreeBuilder
7777
->validate()
7878
->ifTrue(function ($v) { return isset($v['jwt'], $v['jwt_provider']); })
7979
->thenInvalid('"jwt" and "jwt_provider" cannot be used together.')
80+
->end()
81+
->validate()
8082
->ifTrue(function ($v) { return !isset($v['jwt']) && !isset($v['jwt_provider']); })
8183
->thenInvalid('You must specify at least one of "jwt", and "jwt_provider".')
84+
->end()
85+
->validate()
8286
->ifTrue(function ($v) { return isset($v['jwt']['value'], $v['jwt']['provider']); })
8387
->thenInvalid('"jwt.value" and "jwt.provider" cannot be used together.')
88+
->end()
89+
->validate()
8490
->ifTrue(function ($v) { return isset($v['jwt']) && !isset($v['jwt']['value']) && !isset($v['jwt']['provider']) && !isset($v['jwt']['factory']) && !isset($v['jwt']['secret']); })
8591
->thenInvalid('You must specify at least one of "jwt.value", "jwt.provider", "jwt.factory", and "jwt.secret".')
8692
->end()

0 commit comments

Comments
 (0)