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

AnnotationsMapper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 75%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A map() 0 7 2
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