Skip to content

Commit 143642d

Browse files
committed
Leverage non-capturing catches
1 parent 7470c1a commit 143642d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Transport/RoundRobinTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa
5151
while ($transport = $this->getNextTransport()) {
5252
try {
5353
return $transport->send($message, $envelope);
54-
} catch (TransportExceptionInterface $e) {
54+
} catch (TransportExceptionInterface) {
5555
$this->deadTransports[$transport] = microtime(true);
5656
}
5757
}

Transport/Smtp/EsmtpTransport.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ private function doEhloCommand(): string
114114
{
115115
try {
116116
$response = $this->executeCommand(sprintf("EHLO %s\r\n", $this->getLocalDomain()), [250]);
117-
} catch (TransportExceptionInterface $e) {
117+
} catch (TransportExceptionInterface) {
118118
return parent::executeCommand(sprintf("HELO %s\r\n", $this->getLocalDomain()), [250]);
119119
}
120120

@@ -135,7 +135,7 @@ private function doEhloCommand(): string
135135
try {
136136
$response = $this->executeCommand(sprintf("EHLO %s\r\n", $this->getLocalDomain()), [250]);
137137
$this->capabilities = $this->parseCapabilities($response);
138-
} catch (TransportExceptionInterface $e) {
138+
} catch (TransportExceptionInterface) {
139139
return parent::executeCommand(sprintf("HELO %s\r\n", $this->getLocalDomain()), [250]);
140140
}
141141
}
@@ -184,7 +184,7 @@ private function handleAuth(array $modes): void
184184
} catch (TransportExceptionInterface $e) {
185185
try {
186186
$this->executeCommand("RSET\r\n", [250]);
187-
} catch (TransportExceptionInterface $_) {
187+
} catch (TransportExceptionInterface) {
188188
// ignore this exception as it probably means that the server error was final
189189
}
190190

Transport/Smtp/SmtpTransport.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function send(RawMessage $message, Envelope $envelope = null): ?SentMessa
138138
if ($this->started) {
139139
try {
140140
$this->executeCommand("RSET\r\n", [250]);
141-
} catch (TransportExceptionInterface $_) {
141+
} catch (TransportExceptionInterface) {
142142
// ignore this exception as it probably means that the server error was final
143143
}
144144
}
@@ -276,7 +276,7 @@ public function stop(): void
276276

277277
try {
278278
$this->executeCommand("QUIT\r\n", [221]);
279-
} catch (TransportExceptionInterface $e) {
279+
} catch (TransportExceptionInterface) {
280280
} finally {
281281
$this->stream->terminate();
282282
$this->started = false;
@@ -292,7 +292,7 @@ private function ping(): void
292292

293293
try {
294294
$this->executeCommand("NOOP\r\n", [250]);
295-
} catch (TransportExceptionInterface $e) {
295+
} catch (TransportExceptionInterface) {
296296
$this->stop();
297297
}
298298
}

0 commit comments

Comments
 (0)