Push::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\Push as PushEntity;
8
9
class Push implements Hydrator
10
{
11
    public function supports($type)
12
    {
13
        return 'push_notification_contact_method' === $type;
14
    }
15
16
    public function hydrate(stdClass $dto)
17
    {
18
        return new PushEntity(
19
            $dto->address,
20
            $dto->device_type,
21
            $dto->sounds,
22
            $dto->blacklisted
23
      );
24
    }
25
}
26