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

ConstantValue::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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