Completed
Push — master ( a2fd0b...cb4835 )
by Andrii
02:30
created

TargetHydrator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A extract() 0 10 1
1
<?php
2
/**
3
 * API for Billing
4
 *
5
 * @link      https://github.com/hiqdev/billing-hiapi
6
 * @package   billing-hiapi
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017-2018, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\billing\hiapi\target;
12
13
use hiqdev\yii\DataMapper\hydrator\GeneratedHydrator;
14
15
/**
16
 * Class TargetHydrator.
17
 *
18
 * @author Andrii Vasyliev <[email protected]>
19
 */
20
class TargetHydrator extends GeneratedHydrator
21
{
22
    /**
23
     * {@inheritdoc}
24
     * @param object|Target $object
25
     */
26
    public function extract($object)
27
    {
28
        $result = array_filter([
29
            'id'            => $object->getId(),
30
            'type'          => $object->getType(),
31
            'name'          => $object->getName(),
32
        ]);
33
34
        return $result;
35
    }
36
}
37