Sms::hydrate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
rs 9.6666
cc 1
eloc 6
nc 1
nop 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\Sms as SmsEntity;
8
9
class Sms implements Hydrator
10
{
11
    public function supports($type)
12
    {
13
        return 'sms_contact_method' === $type;
14
    }
15
16
    public function hydrate(stdClass $dto)
17
    {
18
        return new SmsEntity(
19
            $dto->address,
20
            $dto->country_code,
21
            $dto->enabled,
22
            $dto->blacklisted
23
        );
24
    }
25
}
26