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

ElementsMapper::map()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 2
crap 2
1
<?php
2
3
namespace Waredesk\Mappers\Code;
4
5
use Waredesk\Collections\Codes\Elements;
6
use Waredesk\Models\Code\Element;
7
8
class ElementsMapper
9
{
10 2
    public function map(Elements $elements, array $data): Elements
11
    {
12 2
        foreach ($data as $element) {
13 2
            $elements->add((new ElementMapper())->map(new Element(), $element));
14
        }
15 2
        return $elements;
16
    }
17
}
18