Email   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 38
c 0
b 0
f 0
wmc 5
lcom 0
cbo 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A __toString() 0 4 1
A email() 0 4 1
A sendShortMail() 0 4 1
A sendHtmlEmail() 0 4 1
1
<?php
2
3
namespace Shrikeh\PagerDuty\Entity\ContactMethod\Resource;
4
5
use Shrikeh\PagerDuty\Entity\ContactMethod\Resource;
6
use Shrikeh\PagerDuty\Entity\ContactMethod\Resource\Type;
7
8
final class Email implements Resource
9
{
10
    use Type;
11
12
    private $emailAddress;
13
    private $sendShortEmail;
14
    private $sendHtmlEmail;
15
16
    public function __construct(
17
        $emailAddress,
18
        $sendShortEmail,
19
        $sendHtmlEmail
20
    ) {
21
        $this->emailAddress = $emailAddress;
22
        $this->sendShortEmail = (bool) $sendShortEmail;
23
        $this->sendHtmlEmail = (bool) $sendHtmlEmail;
24
    }
25
26
    public function __toString()
27
    {
28
        return $this->email();
29
    }
30
31
    public function email()
32
    {
33
        return $this->emailAddress;
34
    }
35
36
    public function sendShortMail()
37
    {
38
        return $this->sendShortEmail;
39
    }
40
41
    public function sendHtmlEmail()
42
    {
43
        return $this->sendHtmlEmail;
44
    }
45
}
46