Completed
Push — master ( a73fad...f8ec74 )
by Baptiste
02:31
created

DirectoriesFactory::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\Definition\LoaderInterface;
7
use Innmind\Immutable\{
8
    Set,
9
    MapInterface
10
};
11
12
final class DirectoriesFactory
13
{
14
    private $loader;
15
16 11
    public function __construct(LoaderInterface $loader)
17
    {
18 11
        $this->loader = $loader;
19 11
    }
20
21
    /**
22
     * @param array<string> $files
23
     *
24
     * @return MapInterface<string, Directory>
0 ignored issues
show
Documentation introduced by
The doc-type MapInterface<string, could not be parsed: Expected "|" or "end of type", but got "<" at position 12. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
25
     */
26 11
    public function make(array $files): MapInterface
27
    {
28 11
        $set = new Set('string');
29
30 11
        foreach ($files as $file) {
31 11
            $set = $set->add($file);
32
        }
33
34 11
        return $this->loader->load($set);
35
    }
36
}
37