Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 74bd8b6

Browse files
committed
bug #32309 Fixing validation for messenger transports retry_strategy service key (weaverryan)
This PR was merged into the 4.3 branch. Discussion ---------- Fixing validation for messenger transports retry_strategy service key | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #32300 | License | MIT | Doc PR | not needed Manually tested locally. `validate()` is too because the defaults are already applied. Commits ------- c6e1837 Fixing validation for messenger transports retry_strategy service key
2 parents 5909e6f + c6e1837 commit 74bd8b6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,9 +1196,14 @@ function ($a) {
11961196
->end()
11971197
->arrayNode('retry_strategy')
11981198
->addDefaultsIfNotSet()
1199-
->validate()
1200-
->ifTrue(function ($v) { return null !== $v['service'] && (isset($v['max_retries']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay'])); })
1201-
->thenInvalid('"service" cannot be used along with the other retry_strategy options.')
1199+
->beforeNormalization()
1200+
->always(function ($v) {
1201+
if (isset($v['service']) && (isset($v['max_retries']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay']))) {
1202+
throw new \InvalidArgumentException('The "service" cannot be used along with the other "retry_strategy" options.');
1203+
}
1204+
1205+
return $v;
1206+
})
12021207
->end()
12031208
->children()
12041209
->scalarNode('service')->defaultNull()->info('Service id to override the retry strategy entirely')->end()

0 commit comments

Comments
 (0)