bug #31028 Fixes unmapped parameter for an error message in HttpClientTrait (dbrumann)

This PR was merged into the 4.3-dev branch.

Discussion
----------

Fixes unmapped parameter for an error message in HttpClientTrait

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ---
| License       | MIT
| Doc PR        | ---

Commits
-------

b9e2046821 Fixes sprintf unmapped parameter.
This commit is contained in:
Fabien Potencier 2019-04-09 08:06:22 +02:00
commit 6a5de47ed7

View File

@ -294,7 +294,7 @@ trait HttpClientTrait
$flags = $flags ?? (JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_PRESERVE_ZERO_FRACTION);
if (!\is_array($value) && !$value instanceof \JsonSerializable) {
throw new InvalidArgumentException(sprintf('Option "json" must be array or JsonSerializable, %s given.', __CLASS__, \is_object($value) ? \get_class($value) : \gettype($value)));
throw new InvalidArgumentException(sprintf('Option "json" must be array or JsonSerializable, %s given.', \is_object($value) ? \get_class($value) : \gettype($value)));
}
try {