Email   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A supports() 0 4 1
A hydrate() 0 8 1
1
<?php
2
3
namespace Shrikeh\PagerDuty\Hydrator\ContactMethod\Resource;
4
5
use stdClass;
6
use Shrikeh\PagerDuty\Hydrator;
7
use Shrikeh\PagerDuty\Entity\ContactMethod\Resource\Email as EmailEntity;
8
9
final class Email implements Hydrator
10
{
11
    public function supports($type)
12
    {
13
        return 'email_contact_method' === $type;
14
    }
15
16
    public function hydrate(stdClass $dto)
17
    {
18
        return new EmailEntity(
19
            $dto->address,
20
            $dto->send_short_email,
21
            $dto->send_html_email
22
        );
23
    }
24
}
25