Failed Conditions
Push — master ( 5f5e96...daf37e )
by Adrien
03:02
created

InMemoryTransport::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace EcodevTests\Felix\Log;
6
7
use PHPUnit\Framework\Assert;
8
use Symfony\Component\Mailer\Envelope;
9
use Symfony\Component\Mailer\SentMessage;
10
use Symfony\Component\Mailer\Transport\TransportInterface;
11
use Symfony\Component\Mime\Email;
12
use Symfony\Component\Mime\RawMessage;
13
14
class InMemoryTransport implements TransportInterface
15
{
16
    public Email $lastMessage;
17
18
    public function __toString(): string
19
    {
20
        return '';
21
    }
22
23
    public function send(RawMessage $message, ?Envelope $envelope = null): ?SentMessage
24
    {
25
        Assert::assertInstanceOf(Email::class, $message);
26
        $this->lastMessage = $message;
27
28
        return null;
29
    }
30
}
31