Passed
Pull Request — 2.1 (#71)
by Vincent
13:18 queued 06:40
created

ConstantValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 3 1
A value() 0 3 1
1
<?php
2
3
namespace Bdf\Prime\Query\Closure\Value;
4
5
use Bdf\Prime\Query\Closure\Value\ComparisonValueInterface;
6
use Closure;
7
use ReflectionFunction;
8
9
/**
10
 * Handle simple constant value expression
11
 */
12
final class ConstantValue implements ComparisonValueInterface
13
{
14
    /**
15
     * @var mixed
16
     */
17
    private $value;
18
19
    /**
20
     * @param mixed $value The constant value
21
     */
22 9
    public function __construct($value)
23
    {
24 9
        $this->value = $value;
25
    }
26
27
    /**
28
     * Get the constant value
29
     *
30
     * @return mixed
31
     */
32 4
    public function value()
33
    {
34 4
        return $this->value;
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40 7
    public function get(ReflectionFunction $reflection)
41
    {
42 7
        return $this->value;
43
    }
44
}
45