Address::getEmail()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php declare(strict_types = 1);
2
3
namespace JDR\Mailer\Email;
4
5
class Address
6
{
7
    /**
8
     * @var string
9
     */
10
    private $email;
11
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
17 11
    public function __construct(string $email, string $name = null)
18
    {
19 11
        $this->email = $email;
20 11
        $this->name = $name;
21 11
    }
22
23
    /**
24
     * Get email address.
25
     *
26
     * @return string
27
     */
28 2
    public function getEmail(): string
29
    {
30 2
        return $this->email;
31
    }
32
33
    /**
34
     * Get display name.
35
     *
36
     * @return string|null
37
     */
38 4
    public function getName()
39
    {
40 4
        return $this->name;
41
    }
42
}
43