Passed
Pull Request — master (#75)
by
unknown
19:10 queued 04:04
created

SumsHydrator   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A extract() 0 4 1
A hydrate() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace hiqdev\php\billing\price;
4
5
use hiqdev\DataMapper\Hydrator\GeneratedHydrator;
0 ignored issues
show
Bug introduced by
The type hiqdev\DataMapper\Hydrator\GeneratedHydrator 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...
6
7
class SumsHydrator extends GeneratedHydrator
8
{
9
    public function hydrate(array $data, $object): object
10
    {
11
        return new Sums($data['sums'] ?? null);
12
    }
13
14
    /**
15
     * {@inheritdoc}
16
     * @param Sums $object
17
     */
18
    public function extract($object): array
19
    {
20
        return [
21
            'values'  => $object->values(),
22
        ];
23
    }
24
}
25