MapFactory::make()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 3
crap 2
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Neo4jBundle\Factory;
5
6
use Innmind\Immutable\Map;
7
8
final class MapFactory
9
{
10 10
    public static function make(string $class, string $type, array $elements)
11
    {
12 10
        $map = new Map('string', $type);
13
14 10
        foreach ($elements as $key => $element) {
15 10
            $map = $map->put($key, $element);
16
        }
17
18 10
        return new $class($map);
19
    }
20
}
21