EnumPriceHydrator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
eloc 5
c 1
b 0
f 1
dl 0
loc 12
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A extract() 0 6 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
 * EnumPrice Hydrator.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class EnumPriceHydrator extends PriceHydrator
19
{
20
    /**
21
     * {@inheritdoc}
22
     * @param object|Plan $object
0 ignored issues
show
Bug introduced by
The type hiqdev\billing\hiapi\price\Plan was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
     */
24
    public function extract($object)
25
    {
26
        return array_merge(parent::extract($object), array_filter([
27
            'unit'          => $this->hydrator->extract($object->getUnit()),
28
            'currency'      => $this->hydrator->extract($object->getCurrency()),
29
            'sums'          => $object->getSums(),
30
        ]));
31
    }
32
}
33