EvaluatedValueListBuilder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 7
dl 0
loc 18
ccs 6
cts 6
cp 1
rs 10
c 1
b 1
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A addResult() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Remorhaz\JSON\Path\Value;
6
7
final class EvaluatedValueListBuilder
8
{
9
10
    private $indexMap = [];
11
12
    private $results = [];
13
14 6
    public function addResult(bool $result, int $outerIndex): self
15
    {
16 6
        $this->indexMap[] = $outerIndex;
17 6
        $this->results[] = $result;
18
19 6
        return $this;
20
    }
21
22 7
    public function build(): EvaluatedValueListInterface
23
    {
24 7
        return new EvaluatedValueList(new IndexMap(...$this->indexMap), ...$this->results);
25
    }
26
}
27