Skip to content

Commit b7a3d3c

Browse files
committed
chore: fix psalm issues
1 parent ff69ea0 commit b7a3d3c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Proto/Frame/Smtp.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public function __construct(
2727

2828
public static function fromString(string $payload, \DateTimeImmutable $time): static
2929
{
30-
$payload = \json_decode($payload, true, 64, \JSON_THROW_ON_ERROR);
31-
/** @var TArrayData $payload */
32-
$message = Message\Smtp::fromArray($payload);
30+
/** @var TArrayData $data */
31+
$data = \json_decode($payload, true, 64, \JSON_THROW_ON_ERROR);
32+
$message = Message\Smtp::fromArray($data);
3333

3434
return new self($message, $time);
3535
}

src/Sender/MailToFileSender.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ public function send(iterable $frames): void
5050
/**
5151
* Get normalized email address for file or directory name.
5252
*
53-
* @param null|non-empty-string $email
53+
* @return null|non-empty-string
5454
*/
5555
private static function normalizeEmail(?string $email): ?string
5656
{
57-
return \trim($email) === '' ? null : \str_replace('@', '[at]', $email);
57+
$email = \str_replace('@', '[at]', \trim((string) $email));
58+
return $email === '' ? null : $email;
5859
}
5960
}

0 commit comments

Comments
 (0)