Passed
Pull Request — master (#50)
by Alex
03:34
created

EdmDirectValueAnnotationBinding::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace AlgoWeb\ODataMetadata\Library\Annotations;
7
8
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IDirectValueAnnotationBinding;
9
use AlgoWeb\ODataMetadata\Interfaces\IEdmElement;
10
11
/**
12
 * Represents the combination of an EDM annotation with an immediate value and the element to which it is attached.
13
 * @package AlgoWeb\ODataMetadata\Library\Annotations
14
 */
15
class EdmDirectValueAnnotationBinding implements IDirectValueAnnotationBinding
16
{
17
    /**
18
     * @var IEdmElement
19
     */
20
    private $element;
21
    /**
22
     * @var string
23
     */
24
    private $namespaceUri;
25
    /**
26
     * @var string
27
     */
28
    private $name;
29
    /**
30
     * @var mixed
31
     */
32
    private $value;
33
34
    /**
35
     * Initializes a new instance of the EdmDirectValueAnnotationBinding class.
36
     * @param IEdmElement $element      element to which the annotation is attached
37
     * @param string      $namespaceUri namespace URI of the annotation
38
     * @param string      $name         name of the annotation within the namespace
39
     * @param mixed       $value        Value of the annotation
40
     */
41
    public function __construct(IEdmElement $element, string $namespaceUri, string $name, $value)
42
    {
43
        $this->element      = $element;
44
        $this->namespaceUri = $namespaceUri;
45
        $this->name         = $name;
46
        $this->value        = $value;
47
    }
48
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function getElement(): IEdmElement
54
    {
55
        return $this->element;
56
    }
57
58
    /**
59
     * {@inheritdoc}
60
     */
61
    public function getNamespaceUri(): string
62
    {
63
        return $this->namespaceUri;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function getName(): string
70
    {
71
        return $this->name;
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function getValue()
78
    {
79
        return $this->value;
80
    }
81
}
82