Fixing validation for messenger transports retry_strategy service key
This commit is contained in:
parent
0d5258a4c7
commit
c6e18374a2
@ -1195,9 +1195,14 @@ class Configuration implements ConfigurationInterface
|
||||
->end()
|
||||
->arrayNode('retry_strategy')
|
||||
->addDefaultsIfNotSet()
|
||||
->validate()
|
||||
->ifTrue(function ($v) { return null !== $v['service'] && (isset($v['max_retries']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay'])); })
|
||||
->thenInvalid('"service" cannot be used along with the other retry_strategy options.')
|
||||
->beforeNormalization()
|
||||
->always(function ($v) {
|
||||
if (isset($v['service']) && (isset($v['max_retries']) || isset($v['delay']) || isset($v['multiplier']) || isset($v['max_delay']))) {
|
||||
throw new \InvalidArgumentException('The "service" cannot be used along with the other "retry_strategy" options.');
|
||||
}
|
||||
|
||||
return $v;
|
||||
})
|
||||
->end()
|
||||
->children()
|
||||
->scalarNode('service')->defaultNull()->info('Service id to override the retry strategy entirely')->end()
|
||||
|
Reference in New Issue
Block a user