Skip to content

Commit d2cdbfc

Browse files
committed
Resolve code review comments from stof and oska
Also fix one mysteriously broken unit test.
1 parent 365253d commit d2cdbfc

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CHANGELOG
55
---
66

77
* Make `TransportFactoryTestCase` compatible with PHPUnit 10+
8-
* Support unicode email addresses such as "dømi@dømi.fo", no client changes needed
8+
* Support unicode email addresses such as "dømi@dømi.fo"
99

1010
7.1
1111
---

Envelope.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public function getRecipients(): array
8383
}
8484

8585
/**
86-
8786
* Returns true if any address' localpart contains at least one
8887
* non-ASCII character, and false if all addresses have all-ASCII
8988
* localparts.
@@ -97,8 +96,6 @@ public function getRecipients(): array
9796
* then it is possible to to send the message using IDN encoding
9897
* instead of SMTPUTF8. The most common software will display the
9998
* message as intended.
100-
*
101-
* @return bool
10299
*/
103100
public function anyAddressHasUnicodeLocalpart(): bool
104101
{

Transport/Smtp/EsmtpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ private function parseCapabilities(string $ehloResponse): array
195195
return $capabilities;
196196
}
197197

198-
protected function serverSupportsSmtputf8(): bool
198+
protected function serverSupportsSmtpUtf8(): bool
199199
{
200200
return \array_key_exists('SMTPUTF8', $this->capabilities);
201201
}

Transport/Smtp/SmtpTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ protected function doSend(SentMessage $message): void
245245
}
246246
}
247247

248-
protected function serverSupportsSmtputf8(): bool
248+
protected function serverSupportsSmtpUtf8(): bool
249249
{
250250
return false;
251251
}
@@ -257,7 +257,7 @@ private function doHeloCommand(): void
257257

258258
private function doMailFromCommand(string $address, bool $smtputf8): void
259259
{
260-
if($smtputf8 && !$this->serverSupportsSmtputf8()) {
260+
if($smtputf8 && !$this->serverSupportsSmtpUtf8()) {
261261
throw new InvalidArgumentException('Invalid addresses: non-ASCII characters not supported in local-part of email.');
262262
}
263263
$this->executeCommand(sprintf("MAIL FROM:<%s>%s\r\n", $address, ($smtputf8 ? " SMTPUTF8" : "")), [250]);

0 commit comments

Comments
 (0)