Completed
Push — develop ( e716a3...960a7a )
by Baptiste
02:59
created

ListDelegationBuilderFactory::make()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Rest\ServerBundle\Factory;
5
6
use Innmind\Rest\Server\Response\HeaderBuilder\{
7
    ListDelegationBuilder,
8
    ListBuilderInterface
9
};
10
use Innmind\Immutable\Set;
11
12
final class ListDelegationBuilderFactory
13
{
14 1
    public function make(array $builders): ListDelegationBuilder
15
    {
16 1
        $set = new Set(ListBuilderInterface::class);
17
18 1
        foreach ($builders as $builder) {
19 1
            $set = $set->add($builder);
20
        }
21
22 1
        return new ListDelegationBuilder($set);
23
    }
24
}
25