Passed
Push — feature-FRAM-112-closure-filte... ( c8f14f )
by Vincent
06:52
created

PropertyValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Bdf\Prime\Query\Closure\Value;
4
5
use ReflectionFunction;
6
7
/**
8
 * Handle property access expression
9
 */
10
final class PropertyValue implements ComparisonValueInterface
11
{
12
    private ComparisonValueInterface $value;
13
    private string $property;
14
15
    /**
16
     * @param ComparisonValueInterface $value Object value expression
17
     * @param string $property The property name
18
     */
19 1
    public function __construct(ComparisonValueInterface $value, string $property)
20
    {
21 1
        $this->value = $value;
22 1
        $this->property = $property;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public function get(ReflectionFunction $reflection)
29
    {
30 1
        return $this->value->get($reflection)->{$this->property};
31
    }
32
}
33