Email   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 62
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAddress() 0 4 1
A setAddress() 0 4 1
A isPrimary() 0 4 1
A getPrimary() 0 4 1
A setPrimary() 0 4 1
1
<?php
2
namespace MrPrompt\ShipmentCommon\Base;
3
4
/**
5
 * E-mail
6
 *
7
 * @author Thiago Paes <[email protected]>
8
 */
9
class Email
10
{
11
    /**
12
     * @var string
13
     */
14
    private $address;
15
16
    /**
17
     * @var boolean
18
     */
19
    private $primary;
20
21
    /**
22
     * @param string $address
23
     * @param bool $primary
24
     */
25 5
    public function __construct(string $address = null, bool $primary = true)
26
    {
27 5
        $this->address = $address;
28 5
        $this->primary = $primary;
29 5
    }
30
31
    /**
32
     * @return string
33
     */
34 1
    public function getAddress(): string
35
    {
36 1
        return $this->address;
37
    }
38
39
    /**
40
     * @param string $address
41
     */
42 1
    public function setAddress(string $address)
43
    {
44 1
        $this->address = $address;
45 1
    }
46
47
    /**
48
     * @return boolean
49
     */
50 1
    public function isPrimary(): bool
51
    {
52 1
        return $this->primary === true;
53
    }
54
55
    /**
56
     * @return boolean
57
     */
58 1
    public function getPrimary(): bool
59
    {
60 1
        return $this->primary;
61
    }
62
63
    /**
64
     * @param boolean $primary
65
     */
66 1
    public function setPrimary(bool $primary = true)
67
    {
68 1
        $this->primary = $primary;
69
    }
70
}