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

Skip to content

Commit 5f87c7b

Browse files
author
Robin Chalas
committed
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 ------- ae0c634 Fix exception message in Doctrine Messenger
2 parents c966016 + ae0c634 commit 5f87c7b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Transport/Doctrine/Connection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,13 @@ public static function buildConfiguration($dsn, array $options = [])
8686
// check for extra keys in options
8787
$optionsExtraKeys = array_diff(array_keys($options), array_keys(self::DEFAULT_OPTIONS));
8888
if (0 < \count($optionsExtraKeys)) {
89-
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', self::DEFAULT_OPTIONS)));
89+
throw new InvalidArgumentException(sprintf('Unknown option found : [%s]. Allowed options are [%s]', implode(', ', $optionsExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
9090
}
9191

9292
// check for extra keys in options
9393
$queryExtraKeys = array_diff(array_keys($query), array_keys(self::DEFAULT_OPTIONS));
9494
if (0 < \count($queryExtraKeys)) {
95-
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', self::DEFAULT_OPTIONS)));
95+
throw new InvalidArgumentException(sprintf('Unknown option found in DSN: [%s]. Allowed options are [%s]', implode(', ', $queryExtraKeys), implode(', ', array_keys(self::DEFAULT_OPTIONS))));
9696
}
9797

9898
return $configuration;

0 commit comments

Comments
 (0)