Passed
Pull Request — master (#53)
by kacper
04:21
created

FieldDTOCollection::makeFromArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 4
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 2
rs 10
1
<?php
2
declare(strict_types=1);
3
4
namespace MySQLReplication\Repository;
5
6
use Doctrine\Common\Collections\ArrayCollection;
7
8
class FieldDTOCollection extends ArrayCollection
9
{
10 55
    public static function makeFromArray(array $fields): self
11
    {
12 55
        $collection = new self();
13 55
        foreach ($fields as $field) {
14 54
            $collection->add(FieldDTO::makeFromArray($field));
15
        }
16
17 55
        return $collection;
18
    }
19
}