Completed
Push — develop ( 99c8cd...370699 )
by Baptiste
02:34
created

RangeExtractorFactory::make()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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