Construct   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __toString() 0 5 1
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 Construct implements Constructor
13
{
14
    private $construct;
15
    private $arguments;
16
17 9
    public function __construct(string $construct, Argument ...$arguments)
18
    {
19 9
        $this->construct = $construct;
20 9
        $this->arguments = Stream::of(Argument::class, ...$arguments);
21 9
    }
22
23 7
    public function __toString(): string
24
    {
25
        return <<<PHP
26 7
new \\{$this->construct}(
27 7
{$this->arguments->join(",\n")}
28
)
29
PHP;
30
    }
31
}
32