Skip to content

Commit efaf94b

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

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
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
}

tests/Unit/Sender/MailToFileSenderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Buggregator\Trap\Proto\Frame\Smtp as SmtpFrame;
99
use Buggregator\Trap\Sender\MailToFileSender;
1010
use Buggregator\Trap\Traffic\Message\Smtp as SmtpMessage;
11-
use DirectoryIterator;
1211
use PHPUnit\Framework\TestCase;
1312

1413
/**

0 commit comments

Comments
 (0)