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

FieldDTOCollection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

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