Mailer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 6 1
1
<?php
2
3
namespace Tworzenieweb\SqlProvisioner\Service;
4
5
use Swift_Mailer;
6
use Swift_Message;
7
8
class Mailer
9
{
10
    /** @var Swift_Mailer  */
11
    private $mailer;
12
13
14
    public function __construct(Swift_Mailer $mailer)
15
    {
16
        $this->mailer = $mailer;
17
    }
18
19
20
    public function send(Swift_Message $message): bool
21
    {
22
        $numberOfEmailsSent = $this->mailer->send($message);
23
24
        return $numberOfEmailsSent > 0;
25
    }
26
}
27