Completed
Push — master ( 175b65...c73746 )
by Alex
18s queued 15s
created

EdmValue   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 4
Bugs 1 Features 0
Metric Value
eloc 6
c 4
b 1
f 0
dl 0
loc 35
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getType() 0 3 1
A __construct() 0 3 1
A getValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace AlgoWeb\ODataMetadata\Library\Values;
7
8
use AlgoWeb\ODataMetadata\Enums\ValueKind;
9
use AlgoWeb\ODataMetadata\Helpers\EdmElementHelpers;
10
use AlgoWeb\ODataMetadata\Interfaces\ITypeReference;
11
use AlgoWeb\ODataMetadata\Interfaces\Values\IDelayedValue;
12
use AlgoWeb\ODataMetadata\Interfaces\Values\IValue;
13
14
/**
15
 * Represents an EDM value.
16
 *
17
 * @package AlgoWeb\ODataMetadata\Library\Values
18
 */
19
abstract class EdmValue implements IValue, IDelayedValue
20
{
21
    use EdmElementHelpers;
22
    /**
23
     * @var ITypeReference type of the value
24
     */
25
    private $type;
26
27
    /**
28
     * Initializes a new instance of the EdmValue class.
29
     *
30
     * @param ITypeReference $type type of the value
31
     */
32
    public function __construct(?ITypeReference $type)
33
    {
34
        $this->type = $type;
35
    }
36
37
38
    /**
39
     * @return ITypeReference gets the type of this value
40
     */
41
    public function getType(): ?ITypeReference
42
    {
43
        return $this->type;
44
    }
45
46
    /**
47
     * @return ValueKind gets the kind of this value
48
     */
49
    abstract public function getValueKind(): ValueKind;
50
51
public function getValue()
52
{
53
    return $this;
54
}
55
}
56