Skip to content

Commit 4095463

Browse files
committed
Leverage non-capturing catches
1 parent 9fa1515 commit 4095463

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

HttpClient/Test/HttpClientTestCase.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,13 @@ public function testClientError()
226226
try {
227227
$response->getHeaders();
228228
$this->fail(ClientExceptionInterface::class.' expected');
229-
} catch (ClientExceptionInterface $e) {
229+
} catch (ClientExceptionInterface) {
230230
}
231231

232232
try {
233233
$response->getContent();
234234
$this->fail(ClientExceptionInterface::class.' expected');
235-
} catch (ClientExceptionInterface $e) {
235+
} catch (ClientExceptionInterface) {
236236
}
237237

238238
$this->assertSame(404, $response->getStatusCode());
@@ -246,7 +246,7 @@ public function testClientError()
246246
$this->assertTrue($chunk->isFirst());
247247
}
248248
$this->fail(ClientExceptionInterface::class.' expected');
249-
} catch (ClientExceptionInterface $e) {
249+
} catch (ClientExceptionInterface) {
250250
}
251251
}
252252

@@ -266,14 +266,14 @@ public function testDnsError()
266266
try {
267267
$response->getStatusCode();
268268
$this->fail(TransportExceptionInterface::class.' expected');
269-
} catch (TransportExceptionInterface $e) {
269+
} catch (TransportExceptionInterface) {
270270
$this->addToAssertionCount(1);
271271
}
272272

273273
try {
274274
$response->getStatusCode();
275275
$this->fail(TransportExceptionInterface::class.' still expected');
276-
} catch (TransportExceptionInterface $e) {
276+
} catch (TransportExceptionInterface) {
277277
$this->addToAssertionCount(1);
278278
}
279279

@@ -283,7 +283,7 @@ public function testDnsError()
283283
foreach ($client->stream($response) as $r => $chunk) {
284284
}
285285
$this->fail(TransportExceptionInterface::class.' expected');
286-
} catch (TransportExceptionInterface $e) {
286+
} catch (TransportExceptionInterface) {
287287
$this->addToAssertionCount(1);
288288
}
289289

@@ -432,7 +432,7 @@ public function testMaxRedirects()
432432
try {
433433
$response->getHeaders();
434434
$this->fail(RedirectionExceptionInterface::class.' expected');
435-
} catch (RedirectionExceptionInterface $e) {
435+
} catch (RedirectionExceptionInterface) {
436436
}
437437

438438
$this->assertSame(302, $response->getStatusCode());
@@ -854,7 +854,7 @@ public function testTimeoutOnInitialize()
854854
try {
855855
$response->getContent();
856856
$this->fail(TransportExceptionInterface::class.' expected');
857-
} catch (TransportExceptionInterface $e) {
857+
} catch (TransportExceptionInterface) {
858858
}
859859
}
860860
$responses = [];
@@ -887,7 +887,7 @@ public function testTimeoutOnDestruct()
887887
try {
888888
unset($response);
889889
$this->fail(TransportExceptionInterface::class.' expected');
890-
} catch (TransportExceptionInterface $e) {
890+
} catch (TransportExceptionInterface) {
891891
}
892892
}
893893

@@ -1105,7 +1105,7 @@ public function testMaxDuration()
11051105

11061106
try {
11071107
$response->getContent();
1108-
} catch (TransportExceptionInterface $e) {
1108+
} catch (TransportExceptionInterface) {
11091109
$this->addToAssertionCount(1);
11101110
}
11111111

0 commit comments

Comments
 (0)