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

DirectoriesFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 25
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A make() 0 10 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