Map::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 11
ccs 5
cts 5
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Compose\Compilation\Service\Constructor;
5
6
use Innmind\Compose\{
7
    Compilation\Service\Constructor,
8
    Compilation\Service\Argument
9
};
10
use Innmind\Immutable\Stream;
11
12
final class Map implements Constructor
13
{
14
    private $key;
15
    private $value;
16
    private $arguments;
17
18 7
    public function __construct(string $key, string $value, Argument ...$arguments)
19
    {
20 7
        $this->key = $key;
21 7
        $this->value = $value;
22 7
        $this->arguments = Stream::of(Argument::class, ...$arguments);
23 7
    }
24
25 5
    public function __toString(): string
26
    {
27
        $code = <<<PHP
28
\\Innmind\\Compose\\Lazy\\Map::of(
29 5
    '{$this->key}',
30 5
    '{$this->value}',
31 5
    {$this->arguments->join(",\n")}
32
)
33
PHP;
34
35 5
        return $code;
36
    }
37
}
38