Completed
Push — master ( e6ba08...9dbf89 )
by Gabriel
02:34
created

AnnotationsMapper::map()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

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