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

SinglePriceHydrator::extract()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 2
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