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

EdmTypeAnnotation   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPropertyValueBindings() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
4
namespace AlgoWeb\ODataMetadata\Library\Annotations;
5
6
use AlgoWeb\ODataMetadata\Helpers\TypeAnnotationHelpers;
7
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IPropertyValueBinding;
8
use AlgoWeb\ODataMetadata\Interfaces\Annotations\ITypeAnnotation;
9
use AlgoWeb\ODataMetadata\Interfaces\ITerm;
10
use AlgoWeb\ODataMetadata\Interfaces\IVocabularyAnnotatable;
11
12
/**
13
 * Represents an EDM type annotation.
14
 * @package AlgoWeb\ODataMetadata\Library\Annotations
15
 */
16
class EdmTypeAnnotation extends EdmVocabularyAnnotation implements ITypeAnnotation
17
{
18
    use TypeAnnotationHelpers;
19
    /**
20
     * @var IPropertyValueBinding[]
21
     */
22
    private $propertyValueBindings;
23
24
    /**
25
     * Initializes a new instance of the EdmTypeAnnotation class.
26
     * @param IVocabularyAnnotatable $target Element the annotation applies to.
27
     * @param ITerm $term Term bound by the annotation.
28
     * @param string|null $qualifier Qualifier used to discriminate between multiple bindings of the same property or type.
29
     * @param IPropertyValueBinding ...$propertyValueBindings Value annotations for the properties of the type.
30
     */
31
    public function __construct(IVocabularyAnnotatable $target, ITerm $term, string $qualifier = null, IPropertyValueBinding ...$propertyValueBindings)
32
    {
33
        parent::__construct($target, $term, $qualifier);
34
        $this->propertyValueBindings = $propertyValueBindings;
35
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41
    public function getPropertyValueBindings(): array
42
    {
43
        return $this->propertyValueBindings;
44
    }
45
46
}