Mailer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 50%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 28
wmc 2
lcom 1
cbo 1
ccs 3
cts 6
cp 0.5
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 4 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Zortje\Emailer;
5
6
use Zortje\Emailer\Adapter\ServiceAdapterInterface;
7
8
/**
9
 * Class Mailer
10
 *
11
 * @package Zortje\Emailer
12
 */
13
class Mailer
14
{
15
16
    /**
17
     * @var ServiceAdapterInterface
18
     */
19
    protected $serviceAdapter;
20
21
    /**
22
     * Mailer constructor.
23
     *
24
     * @param ServiceAdapterInterface $serviceAdapter
25
     */
26 1
    public function __construct(ServiceAdapterInterface $serviceAdapter)
27
    {
28 1
        $this->serviceAdapter = $serviceAdapter;
29 1
    }
30
31
    /**
32
     * Send email
33
     *
34
     * @param Email $email
35
     */
36
    public function send(Email $email)
37
    {
38
        $this->serviceAdapter->send($email);
39
    }
40
}
41