Skip to content

Commit 88f5833

Browse files
committed
Merge branch '5.0'
* 5.0: Fix code Tweak the code to avoid fabbot false positives
2 parents 4f09f0d + 93b4157 commit 88f5833

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

HttpClientTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,11 @@ private static function jsonEncode($value, int $flags = null, int $maxDepth = 51
357357
try {
358358
$value = json_encode($value, $flags | (\PHP_VERSION_ID >= 70300 ? JSON_THROW_ON_ERROR : 0), $maxDepth);
359359
} catch (\JsonException $e) {
360-
throw new InvalidArgumentException(sprintf('Invalid value for "json" option: %s.', $e->getMessage()));
360+
throw new InvalidArgumentException('Invalid value for "json" option: '.$e->getMessage());
361361
}
362362

363363
if (\PHP_VERSION_ID < 70300 && JSON_ERROR_NONE !== json_last_error() && (false === $value || !($flags & JSON_PARTIAL_OUTPUT_ON_ERROR))) {
364-
throw new InvalidArgumentException(sprintf('Invalid value for "json" option: %s.', json_last_error_msg()));
364+
throw new InvalidArgumentException('Invalid value for "json" option: '.json_last_error_msg());
365365
}
366366

367367
return $value;

Response/ResponseTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ public function toArray(bool $throw = true): array
153153
try {
154154
$content = json_decode($content, true, 512, JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 ? JSON_THROW_ON_ERROR : 0));
155155
} catch (\JsonException $e) {
156-
throw new JsonException(sprintf('%s for "%s".', $e->getMessage(), $this->getInfo('url')), $e->getCode());
156+
throw new JsonException(sprintf($e->getMessage().' for "%s".', $this->getInfo('url')), $e->getCode());
157157
}
158158

159159
if (\PHP_VERSION_ID < 70300 && JSON_ERROR_NONE !== json_last_error()) {
160-
throw new JsonException(sprintf('%s for "%s".', json_last_error_msg(), $this->getInfo('url')), json_last_error());
160+
throw new JsonException(sprintf(json_last_error_msg().' for "%s".', $this->getInfo('url')), json_last_error());
161161
}
162162

163163
if (!\is_array($content)) {

0 commit comments

Comments
 (0)