8000 Fixing validation for messenger transports retry_strategy service key · symfony/symfony@c6e1837 · GitHub
[go: up one dir, main page]

Skip to content

Commit c6e1837

Browse files
committed
Fixing validation for messenger transports retry_strategy service key
1 parent 0d5258a commit c6e1837

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
@@ -1195,9 +1195,14 @@ function ($a) {
11951195
->end()
11961196
->arrayNode('retry_strategy')
11971197
->addDefaultsIfNotSet()
1198-
->validate()
1199-
->ifTrue(function ($v) { return null !== $v['service'] && (isset($v['max_retries']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay'])); })
1200-
->thenInvalid('"service" cannot be used along with the other retry_strategy options.')
1198+
->beforeNormalization()
1199+
->always(function ($v) {
1200+
if (isset($v['service']) && (isset($v['max_retries']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay']))) {
1201+
throw new \InvalidArgumentException('The "service" cannot be used along with the other "retry_strategy" options.');
1202+
}
1203+
1204+
return $v;
1205+
})
12011206
->end()
12021207
->children()
12031208
->scalarNode('service')->defaultNull()->info('Service id to override the retry strategy entirely')->end()

0 commit comments

Comments
 (0)
0