Completed
Push — master ( 80ac75...5f10d0 )
by Andrii
05:33
created

SinglePriceHydrator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 2
dl 0
loc 14
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A extract() 0 7 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\price;
12
13
/**
14
 * SinglePrice Hydrator.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class SinglePriceHydrator extends PriceHydrator
19
{
20
    /**
21
     * {@inheritdoc}
22
     * @param object|Plan $object
23
     */
24
    public function extract($object)
25
    {
26
        return array_merge(parent::extract($object), array_filter([
27
            'prepaid'       => $this->hydrator->extract($object->getPrepaid()),
28
            'price'         => $this->hydrator->extract($object->getPrice()),
29
        ]));
30
    }
31
}
32