Completed
Push — master ( ebed30...ed4555 )
by Edward
04:50
created

EvaluatedValueListBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 7
dl 0
loc 18
ccs 0
cts 6
cp 0
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
declare(strict_types=1);
3
4
namespace Remorhaz\JSON\Path\Value;
5
6
final class EvaluatedValueListBuilder
7
{
8
9
    private $indexMap = [];
10
11
    private $results = [];
12
13
    public function addResult(bool $result, int $outerIndex): self
14
    {
15
        $this->indexMap[] = $outerIndex;
16
        $this->results[] = $result;
17
18
        return $this;
19
    }
20
21
    public function build(): EvaluatedValueListInterface
22
    {
23
        return new EvaluatedValueList(new IndexMap(...$this->indexMap), ...$this->results);
24
    }
25
}
26