Passed
Push — master ( c69a90...df5d45 )
by Edward
04:44
created

LiteralArrayValue::createEventGenerator()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 0
dl 0
loc 9
ccs 0
cts 6
cp 0
crap 6
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Remorhaz\JSON\Path\Value;
5
6
use ArrayIterator;
7
use Iterator;
8
use Remorhaz\JSON\Data\Value\ArrayValueInterface;
9
use Remorhaz\JSON\Data\Value\ValueInterface;
10
11
final class LiteralArrayValue implements ArrayValueInterface, LiteralValueInterface
12
{
13
14
    private $indexMap;
15
16
    private $values;
17
18
    public function __construct(IndexMapInterface $indexMap, ValueInterface ...$values)
19
    {
20
        $this->indexMap = $indexMap;
21
        $this->values = $values;
22
    }
23
24
    public function createChildIterator(): Iterator
25
    {
26
        return new ArrayIterator($this->values);
27
    }
28
}
29