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

InMemoryTransport   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 15
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A send() 0 6 1
A __toString() 0 3 1
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