GatewaysFactory::make()   A
last analyzed

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\Gateway;
7
use Innmind\Immutable\{
8
    Map,
9
    MapInterface
10
};
11
12
final class GatewaysFactory
13
{
14
    /**
15
     * @param Gateway[]
16
     *
17
     * @return MapInterface<string, Gateway>
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...
18
     */
19 26
    public function make(array $gateways): MapInterface
20
    {
21 26
        $map = new Map('string', Gateway::class);
22
23 26
        foreach ($gateways as $name => $gateway) {
24 26
            $map = $map->put($name, $gateway);
25
        }
26
27 26
        return $map;
28
    }
29
}
30