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

EdmVocabularyAnnotation   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 52
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getTarget() 0 3 1
A getTerm() 0 3 1
A getQualifier() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
4
namespace AlgoWeb\ODataMetadata\Library\Annotations;
5
6
use AlgoWeb\ODataMetadata\Helpers\VocabularyAnnotationHelpers;
7
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IVocabularyAnnotation;
8
use AlgoWeb\ODataMetadata\Interfaces\ITerm;
9
use AlgoWeb\ODataMetadata\Interfaces\IVocabularyAnnotatable;
10
use AlgoWeb\ODataMetadata\Library\EdmElement;
11
12
/**
13
 * Represents an EDM annotation with an immediate value.
14
 * @package AlgoWeb\ODataMetadata\Library\Annotations
15
 */
16
abstract class EdmVocabularyAnnotation extends EdmElement implements IVocabularyAnnotation
17
{
18
    use VocabularyAnnotationHelpers;
19
20
    /**
21
     * @var IVocabularyAnnotatable
22
     */
23
    private $target;
24
    /**
25
     * @var ITerm
26
     */
27
        private $term;
28
    /**
29
     * @var string
30
     */
31
        private $qualifier;
32
33
    /**
34
     * Initializes a new instance of the EdmVocabularyAnnotation class.
35
     * @param IVocabularyAnnotatable $target Element the annotation applies to.
36
     * @param ITerm $term Term bound by the annotation.
37
     * @param string $qualifier Qualifier used to discriminate between multiple bindings of the same property or type.
38
     */
39
        protected function __construct(IVocabularyAnnotatable $target, ITerm $term, ?string $qualifier)
40
        {
41
            $this->target = $target;
42
            $this->term = $term;
43
            $this->qualifier = $qualifier;
44
        }
45
46
    /**
47
     * @inheritDoc
48
     */
49
    public function getQualifier(): ?string
50
    {
51
        return $this->qualifier;
52
    }
53
54
    /**
55
     * @inheritDoc
56
     */
57
    public function getTerm(): ITerm
58
    {
59
        return $this->term;
60
    }
61
62
    /**
63
     * @inheritDoc
64
     */
65
    public function getTarget(): IVocabularyAnnotatable
66
    {
67
        return $this->target;
68
    }
69
70
}