Skip to content

Commit c11d6e0

Browse files
committed
Code style conformance and dependency updates.
1 parent 3fbbb23 commit c11d6e0

File tree

5 files changed

+39
-37
lines changed

5 files changed

+39
-37
lines changed

src/Symfony/Component/Mailer/Envelope.php

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -83,27 +83,31 @@ public function getRecipients(): array
8383
}
8484

8585
/**
86-
* Returns true if any address' localpart contains at least one
87-
* non-ASCII character, and false if all addresses have all-ASCII
88-
* localparts.
89-
*
90-
* This helps to decide whether to the SMTPUTF8 extensions (RFC
91-
* 6530 and following) for any given message.
92-
*
93-
* The SMTPUTF8 extension is strictly required if any address
94-
* contains a non-ASCII character in its localpart. If non-ASCII
95-
* is only used in domains (e.g. horst@freiherr-von-mühlhausen.de)
96-
* then it is possible to to send the message using IDN encoding
97-
* instead of SMTPUTF8. The most common software will display the
98-
* message as intended.
99-
*/
86+
* Returns true if any address' localpart contains at least one
87+
* non-ASCII character, and false if all addresses have all-ASCII
88+
* localparts.
89+
*
90+
* This helps to decide whether to the SMTPUTF8 extensions (RFC
91+
* 6530 and following) for any given message.
92+
*
93+
* The SMTPUTF8 extension is strictly required if any address
94+
* contains a non-ASCII character in its localpart. If non-ASCII
95+
* is only used in domains (e.g. horst@freiherr-von-mühlhausen.de)
96+
* then it is possible to to send the message using IDN encoding
97+
* instead of SMTPUTF8. The most common software will display the
98+
* message as intended.
99+
*/
100100
public function anyAddressHasUnicodeLocalpart(): bool
101101
{
102-
if($this->getSender()->hasUnicodeLocalpart())
102+
if ($this->getSender()->hasUnicodeLocalpart()) {
103103
return true;
104-
foreach($this->getRecipients() as $r)
105-
if($r->hasUnicodeLocalpart())
104+
}
105+
foreach ($this->getRecipients() as $r) {
106+
if ($r->hasUnicodeLocalpart()) {
106107
return true;
108+
}
109+
}
110+
107111
return false;
108112
}
109113
}

src/Symfony/Component/Mailer/Tests/EnvelopeTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313

1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Component\Mailer\Envelope;
16-
use Symfony\Component\Mailer\Exception\InvalidArgumentException;
1716
use Symfony\Component\Mailer\Exception\LogicException;
1817
use Symfony\Component\Mime\Address;
1918
use Symfony\Component\Mime\Header\Headers;
20-
use Symfony\Component\Mime\Header\PathHeader;
2119
use Symfony\Component\Mime\Message;
2220
use Symfony\Component\Mime\RawMessage;
2321

src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ 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
}
263-
$this->executeCommand(sprintf("MAIL FROM:<%s>%s\r\n", $address, ($smtputf8 ? " SMTPUTF8" : "")), [250]);
263+
$this->executeCommand(\sprintf("MAIL FROM:<%s>%s\r\n", $address, $smtputf8 ? ' SMTPUTF8' : ''), [250]);
264264
}
265265

266266
private function doRcptToCommand(string $address): void

src/Symfony/Component/Mailer/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"psr/event-dispatcher": "^1",
2222
"psr/log": "^1|^2|^3",
2323
"symfony/event-dispatcher": "^6.4|^7.0",
24-
"symfony/mime": "^6.4|^7.0",
24+
"symfony/mime": "^7.2",
2525
"symfony/service-contracts": "^2.5|^3"
2626
},
2727
"require-dev": {

src/Symfony/Component/Mime/Address.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,22 @@ public static function createArray(array $addresses): array
119119
}
120120

121121
/**
122-
* Returns true if this address' localpart contains at least one
123-
* non-ASCII character, and false if it is only ASCII (or empty).
124-
*
125-
* This is a helper for Envelope, which has to decide whether to
126-
* the SMTPUTF8 extensions (RFC 6530 and following) for any given
127-
* message.
128-
*
129-
* The SMTPUTF8 extension is strictly required if any address
130-
* contains a non-ASCII character in its localpart. If non-ASCII
131-
* is only used in domains (e.g. horst@freiherr-von-mühlhausen.de)
132-
* then it is possible to to send the message using IDN encoding
133-
* instead of SMTPUTF8. The most common software will display the
134-
* message as intended.
135-
*/
122+
* Returns true if this address' localpart contains at least one
123+
* non-ASCII character, and false if it is only ASCII (or empty).
124+
*
125+
* This is a helper for Envelope, which has to decide whether to
126+
* the SMTPUTF8 extensions (RFC 6530 and following) for any given
127+
* message.
128+
*
129+
* The SMTPUTF8 extension is strictly required if any address
130+
* contains a non-ASCII character in its localpart. If non-ASCII
131+
* is only used in domains (e.g. horst@freiherr-von-mühlhausen.de)
132+
* then it is possible to to send the message using IDN encoding
133+
* instead of SMTPUTF8. The most common software will display the
134+
* message as intended.
135+
*/
136136
public function hasUnicodeLocalpart(): bool
137137
{
138-
return (bool) preg_match( '/[\x80-\xFF].*@/', $this->address);
138+
return (bool) preg_match('/[\x80-\xFF].*@/', $this->address);
139139
}
140140
}

0 commit comments

Comments
 (0)