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

ArrayValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 9 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