Completed
Push — master ( c3c281...ab94e9 )
by Gabriel
03:37
created

PricesMapper::map()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
crap 6
1
<?php
2
3
namespace Waredesk\Mappers\Product\Variant;
4
5
use Waredesk\Collections\Products\Variants\Prices;
6
use Waredesk\Models\Product\Variant\Price;
7
8
class PricesMapper
9
{
10
    public function map(Prices $prices, array $data): Prices
11
    {
12
        foreach ($data as $priceData) {
13
            $prices->add((new PriceMapper())->map(new Price(), $priceData));
14
        }
15
        return $prices;
16
    }
17
}
18