minor #35487 [Messenger] Fix messenger argument (jderusse)

This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix messenger argument

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

`Connection::DEFAULT_OPTIONS` is an key/value array. The exception `Unknown option found : [%s]. Allowed options are [%s]` should use allowed option's key instead of the value.

Commits
-------

ae0c6344b4 Fix exception message in Doctrine Messenger
This commit is contained in:
Robin Chalas 2020-01-27 23:28:36 +01:00
commit 5f87c7b434
1 changed files with 2 additions and 2 deletions

View File

@ -86,13 +86,13 @@ class Connection
// check for extra keys in options
$optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS));
if (0 < \count($optionsExtraKeys)) {
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', self::DEFAULT_OPTIONS)));
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
}
// check for extra keys in options
$queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS));
if (0 < \count($queryExtraKeys)) {
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', self::DEFAULT_OPTIONS)));
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
}
return $configuration;