Skip to content

Commit f095c7b

Browse files
committed
Leverage class name literal on object
1 parent 153540b commit f095c7b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

RetryableHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function request(string $method, string $url, array $options = []): Respo
7373
if ('' !== $context->getInfo('primary_ip')) {
7474
$shouldRetry = $this->strategy->shouldRetry($context, null, $exception);
7575
if (null === $shouldRetry) {
76-
throw new \LogicException(sprintf('The "%s::shouldRetry()" method must not return null when called with an exception.', \get_class($this->strategy)));
76+
throw new \LogicException(sprintf('The "%s::shouldRetry()" method must not return null when called with an exception.', $this->strategy::class));
7777
}
7878

7979
if (false === $shouldRetry) {
@@ -104,7 +104,7 @@ public function request(string $method, string $url, array $options = []): Respo
104104
}
105105

106106
if (null === $shouldRetry = $this->strategy->shouldRetry($context, $content, null)) {
107-
throw new \LogicException(sprintf('The "%s::shouldRetry()" method must not return null when called with a body.', \get_class($this->strategy)));
107+
throw new \LogicException(sprintf('The "%s::shouldRetry()" method must not return null when called with a body.', $this->strategy::class));
108108
}
109109

110110
if (false === $shouldRetry) {

Tests/HttplugClientTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ public function testRetryNetworkError()
204204
return $response;
205205
}, function (\Exception $exception) use (&$failureCallableCalled, $client) {
206206
$this->assertSame(NetworkException::class, $exception::class);
207-
$this->assertSame(TransportException::class, \get_class($exception->getPrevious()));
207+
$this->assertSame(TransportException::class, $exception->getPrevious()::class);
208208
$failureCallableCalled = true;
209209

210210
return $client->sendAsyncRequest($client->createRequest('GET', 'http://localhost:8057'));

0 commit comments

Comments
 (0)