Completed
Push — master ( c73746...57e5ee )
by Alex
14s queued 12s
created

EdmDirectValueAnnotationBinding::value()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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