Passed
Pull Request — master (#75)
by
unknown
10:56
created

SumsHydrator::hydrate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
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