Arguments   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 8 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Compose\Compilation;
5
6
use Innmind\Compose\{
7
    Arguments as Container,
8
    Definition
9
};
10
use Innmind\Immutable\Set;
11
12
final class Arguments
13
{
14
    private $arguments;
15
16 9
    public function __construct(Container $arguments)
17
    {
18 9
        $this->arguments = $arguments
19 9
            ->all()
20 9
            ->reduce(
21 9
                Set::of(Argument::class),
22 9
                static function(Set $arguments, Definition\Argument $argument): Set {
23 5
                    return $arguments->add($argument->compile());
24 9
                }
25
            );
26 9
    }
27
28 7
    public function __toString(): string
29
    {
30 7
        return (string) $this->arguments->join("\n\n");
31
    }
32
}
33