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

EdmDirectValueAnnotation::getValue()   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\EdmUtil;
7
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IDirectValueAnnotation;
8
use AlgoWeb\ODataMetadata\Library\EdmNamedElement;
9
10
/**
11
 * Represents an EDM annotation with an immediate native value.
12
 *
13
 * @package AlgoWeb\ODataMetadata\Library\Annotations
14
 */
15
class EdmDirectValueAnnotation extends EdmNamedElement implements IDirectValueAnnotation
16
{
17
    /**
18
     * @var mixed
19
     */
20
private $value;
21
    /**
22
     * @var string
23
     */
24
private $namespaceUri;
25
26
    /**
27
     * Initializes a new instance of the EdmDirectValueAnnotation class.
28
     * @param string $namespaceUri Namespace URI of the annotation.
29
     * @param string $name Name of the annotation within the namespace.
30
     * @param mixed $value Value of the annotation
31
     */
32
public function __construct(string $namespaceUri, string $name, $value = null)
33
{
34
    parent::__construct($name);
35
    $this->namespaceUri = $namespaceUri;
36
    $this->value = $value;
37
}
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function getNamespaceUri(): string
43
    {
44
        return $this->namespaceUri;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function getValue()
51
    {
52
        return $this->value;
53
    }
54
}