Skip to content

Commit 05431fd

Browse files
committed
Fix quotes in exception messages
1 parent c8a64b9 commit 05431fd

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Internal/AmpBody.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ private function doRead(): Promise
133133
}
134134

135135
if (!\is_string($data)) {
136-
throw new TransportException(sprintf('Return value of the "body" option callback must be string, %s returned.', \gettype($data)));
136+
throw new TransportException(sprintf('Return value of the "body" option callback must be string, "%s" returned.', \gettype($data)));
137137
}
138138

139139
return new Success($data);

NoPrivateNetworkHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ final class NoPrivateNetworkHttpClient implements HttpClientInterface, LoggerAwa
5454
public function __construct(HttpClientInterface $client, $subnets = null)
5555
{
5656
if (!(\is_array($subnets) || \is_string($subnets) || null === $subnets)) {
57-
throw new \TypeError(sprintf('Argument 2 passed to %s() must be of the type array, string or null. %s given.', __METHOD__, \is_object($subnets) ? \get_class($subnets) : \gettype($subnets)));
57+
throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be of the type array, string or null. "%s" given.', __METHOD__, \is_object($subnets) ? \get_class($subnets) : \gettype($subnets)));
5858
}
5959

6060
if (!class_exists(IpUtils::class)) {
@@ -72,7 +72,7 @@ public function request(string $method, string $url, array $options = []): Respo
7272
{
7373
$onProgress = $options['on_progress'] ?? null;
7474
if (null !== $onProgress && !\is_callable($onProgress)) {
75-
throw new InvalidArgumentException(sprintf('Option "on_progress" must be callable, %s given.', \is_object($onProgress) ? \get_class($onProgress) : \gettype($onProgress)));
75+
throw new InvalidArgumentException(sprintf('Option "on_progress" must be callable, "%s" given.', \is_object($onProgress) ? \get_class($onProgress) : \gettype($onProgress)));
7676
}
7777

7878
$subnets = $this->subnets;

Tests/NoPrivateNetworkHttpClientTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function testNonCallableOnProgressCallback()
113113
$customCallback = sprintf('cb_%s', microtime(true));
114114

115115
$this->expectException(InvalidArgumentException::class);
116-
$this->expectExceptionMessage('Option "on_progress" must be callable, string given.');
116+
$this->expectExceptionMessage('Option "on_progress" must be callable, "string" given.');
117117

118118
$client = new NoPrivateNetworkHttpClient(new MockHttpClient());
119119
$client->request('GET', $url, ['on_progress' => $customCallback]);
@@ -122,7 +122,7 @@ public function testNonCallableOnProgressCallback()
122122
public function testConstructor()
123123
{
124124
$this->expectException(\TypeError::class);
125-
$this->expectExceptionMessage('Argument 2 passed to Symfony\Component\HttpClient\NoPrivateNetworkHttpClient::__construct() must be of the type array, string or null. integer given.');
125+
$this->expectExceptionMessage('Argument 2 passed to "Symfony\Component\HttpClient\NoPrivateNetworkHttpClient::__construct()" must be of the type array, string or null. "integer" given.');
126126

127127
new NoPrivateNetworkHttpClient(new MockHttpClient(), 3);
128128
}

TraceableHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ public function stream($responses, float $timeout = null): ResponseStreamInterfa
6767
if ($responses instanceof TraceableResponse) {
6868
$responses = [$responses];
6969
} elseif (!is_iterable($responses)) {
70-
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of TraceableResponse objects, %s given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
70+
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of TraceableResponse objects, "%s" given.', __METHOD__, \is_object($responses) ? \get_class($responses) : \gettype($responses)));
7171
}
7272

7373
return $this->client->stream(\Closure::bind(static function () use ($responses) {
7474
foreach ($responses as $k => $r) {
7575
if (!$r instanceof TraceableResponse) {
76-
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of TraceableResponse objects, %s given.', __METHOD__, \is_object($r) ? \get_class($r) : \gettype($r)));
76+
throw new \TypeError(sprintf('%s() expects parameter 1 to be an iterable of TraceableResponse objects, "%s" given.', __METHOD__, \is_object($r) ? \get_class($r) : \gettype($r)));
7777
}
7878

7979
yield $k => $r->response;

0 commit comments

Comments
 (0)