Mailer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 18
rs 10
wmc 3

2 Methods

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