Mailer::send()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Mailer;
6
7
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
8
use Symfony\Component\Mailer\MailerInterface;
9
use Symfony\Component\Mime\Email;
10
11
final class Mailer
12
{
13
    private MailerInterface $mailer;
14
15
    public function __construct(MailerInterface $mailer)
16
    {
17
        $this->mailer = $mailer;
18
    }
19
20
    /**
21
     * @throws TransportExceptionInterface
22
     */
23
    public function send(Email $email): void
24
    {
25
        try {
26
            $this->mailer->send($email);
27
        } catch (TransportExceptionInterface $e) {
28
            throw $e;
29
        }
30
    }
31
}
32