Completed
Push — master ( f8a59f...796b11 )
by Dmitry
02:31
created

PriceHydrator   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 27
ccs 0
cts 10
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A hydrateMultiple() 0 9 2
A hydrate() 0 4 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\repositories;
4
5
class PriceHydrator implements HydratorInterface
6
{
7
    /**
8
     * @var PriceFactory
9
     */
10
    private $priceFactory;
11
12
    function __construct(PriceFactory $priceFactory)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
13
    {
14
        $this->priceFactory = $priceFactory;
15
    }
16
17
    public function hydrateMultiple(array $data)
18
    {
19
        $result = [];
20
        foreach ($data as $item) {
21
            $result[] = $this->priceFactory->createByDto(PriceCreationDto::fromArray($item));
22
        }
23
24
        return $result;
25
    }
26
    
27
    public function hydrate($object, array $data)
28
    {
29
30
    }
31
}
32