TypeHydrator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A extract() 0 8 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\type;
12
13
use hiqdev\billing\hiapi\models\Type;
14
use hiqdev\yii\DataMapper\hydrator\GeneratedHydrator;
15
16
/**
17
 * Class TypeHydrator.
18
 *
19
 * @author Andrii Vasyliev <[email protected]>
20
 */
21
class TypeHydrator extends GeneratedHydrator
22
{
23
    /**
24
     * {@inheritdoc}
25
     * @param object|Type $object
26
     */
27
    public function extract($object)
28
    {
29
        $result = array_filter([
30
            'id'            => $object->getId(),
0 ignored issues
show
Bug introduced by
The method getId() does not exist on hiqdev\billing\hiapi\models\Type. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

30
            'id'            => $object->/** @scrutinizer ignore-call */ getId(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
31
            'name'          => $object->getName(),
0 ignored issues
show
Bug introduced by
The method getName() does not exist on hiqdev\billing\hiapi\models\Type. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
            'name'          => $object->/** @scrutinizer ignore-call */ getName(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
32
        ]);
33
34
        return $result;
35
    }
36
}
37