Passed
Pull Request — 2.1 (#71)
by Vincent
14:21 queued 08:17
created

ArrayValue::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Bdf\Prime\Query\Closure\Value;
4
5
use Bdf\Prime\Query\Closure\Value\ComparisonValueInterface;
6
use ReflectionFunction;
7
8
/**
9
 * Handle array expression value
10
 */
11
class ArrayValue implements ComparisonValueInterface
12
{
13
    /**
14
     * @var array<array-key, ComparisonValueInterface>
0 ignored issues
show
Documentation Bug introduced by
The doc comment array<array-key, ComparisonValueInterface> at position 2 could not be parsed: Unknown type name 'array-key' at position 2 in array<array-key, ComparisonValueInterface>.
Loading history...
15
     */
16
    private array $values;
17
18 2
    public function __construct(array $values)
19
    {
20 2
        $this->values = $values;
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 2
    public function get(ReflectionFunction $reflection)
27
    {
28 2
        $values = [];
29
30 2
        foreach ($this->values as $key => $value) {
31 2
            $values[$key] = $value->get($reflection);
32
        }
33
34 2
        return $values;
35
    }
36
}
37