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

EdmValueAnnotation::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
7
use AlgoWeb\ODataMetadata\Helpers\ValueAnnotationHelpers;
8
use AlgoWeb\ODataMetadata\Helpers\VocabularyAnnotationHelpers;
9
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IValueAnnotation;
10
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IVocabularyAnnotation;
11
use AlgoWeb\ODataMetadata\Interfaces\Expressions\IExpression;
12
use AlgoWeb\ODataMetadata\Interfaces\ITerm;
13
use AlgoWeb\ODataMetadata\Interfaces\IVocabularyAnnotatable;
14
use AlgoWeb\ODataMetadata\Library\EdmElement;
15
16
/**
17
 * Represents an EDM value annotation.
18
 *
19
 * @package AlgoWeb\ODataMetadata\Library\Annotations
20
 */
21
class EdmValueAnnotation extends EdmVocabularyAnnotation implements IValueAnnotation
22
{
23
    use ValueAnnotationHelpers;
24
25
    private $value;
26
27
    /**
28
     * Initializes a new instance of the EdmValueAnnotation class.
29
     * @param IVocabularyAnnotatable $target Element the annotation applies to.
30
     * @param ITerm $term Term bound by the annotation.
31
     * @param string $qualifier Qualifier used to discriminate between multiple bindings of the same property or type.
32
     * @param IExpression $value Expression producing the value of the annotation.
33
     */
34
    public function __construct(IVocabularyAnnotatable $target, ITerm $term, string $qualifier, IExpression $value)
35
    {
36
        parent::__construct($target, $term, $qualifier);
37
        $this->value = $value;
38
39
    }
40
41
    /**
42
     * @inheritDoc
43
     */
44
    public function getValue(): IExpression
45
    {
46
        return $this->value;
47
    }
48
}