Skip to content

Commit 4edc75b

Browse files
authored
Merge pull request #164 from Nyholm/patch-2
Use class constants in exception messages
2 parents dbb6c4b + 91608c4 commit 4edc75b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/FlexibleHttpClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class FlexibleHttpClient implements HttpClient, HttpAsyncClient
2525
public function __construct($client)
2626
{
2727
if (!($client instanceof ClientInterface) && !($client instanceof HttpAsyncClient)) {
28-
throw new \LogicException('Client must be an instance of Psr\\Http\\Client\\ClientInterface or Http\\Client\\HttpAsyncClient');
28+
throw new \LogicException(sprintf('Client must be an instance of %s or %s', ClientInterface::class, HttpAsyncClient::class));
2929
}
3030

3131
$this->httpClient = $client;

src/PluginClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function __construct($client, array $plugins = [], array $options = [])
6060
} elseif ($client instanceof ClientInterface) {
6161
$this->client = new EmulatedHttpAsyncClient($client);
6262
} else {
63-
throw new \RuntimeException('Client must be an instance of Psr\\Http\\Client\\ClientInterface or Http\\Client\\HttpAsyncClient');
63+
throw new \LogicException(sprintf('Client must be an instance of %s or %s', ClientInterface::class, HttpAsyncClient::class));
6464
}
6565

6666
$this->plugins = $plugins;

0 commit comments

Comments
 (0)