Skip to content

Commit cf050ec

Browse files
committed
chore: bump PHP requirement to 8.1+, use first-class callables
Raise minimum PHP version from 8.0 to 8.1 in composer.json and use first-class callable syntax (self::method(...)) for array_map calls in the Email constructor.
1 parent 92aaa27 commit cf050ec

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
}
2323
},
2424
"require": {
25-
"php": ">=8.0.0",
25+
"php": ">=8.1.0",
2626
"ext-curl": "*",
2727
"ext-openssl": "*",
2828
"phpmailer/phpmailer": "6.9.1",

composer.lock

Lines changed: 25 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Utopia/Messaging/Messages/Email.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public function __construct(
4848
private ?array $attachments = null,
4949
private bool $html = false,
5050
) {
51-
$this->to = \array_map([self::class, 'normalizeRecipient'], $to);
52-
$this->cc = !\is_null($cc) ? \array_map([self::class, 'normalizeRecipient'], $cc) : null;
53-
$this->bcc = !\is_null($bcc) ? \array_map([self::class, 'normalizeRecipient'], $bcc) : null;
51+
$this->to = \array_map(self::normalizeRecipient(...), $to);
52+
$this->cc = !\is_null($cc) ? \array_map(self::normalizeRecipient(...), $cc) : null;
53+
$this->bcc = !\is_null($bcc) ? \array_map(self::normalizeRecipient(...), $bcc) : null;
5454

5555
if (\is_null($this->replyToName)) {
5656
$this->replyToName = $this->fromName;

0 commit comments

Comments
 (0)