Skip to content
Permalink
Browse files

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
  • Loading branch information...
fabpot committed Jul 3, 2019
2 parents 5909e6f + c6e1837 commit 74bd8b6bca7a2a305ec97358a5a3887762fafcfd
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
@@ -1196,9 +1196,14 @@ function ($a) {
->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()

0 comments on commit 74bd8b6

Please sign in to comment.
You can’t perform that action at this time.