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

EdmPropertyValueBinding   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 36
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBoundProperty() 0 3 1
A __construct() 0 4 1
A getValue() 0 3 1
1
<?php
2
3
4
namespace AlgoWeb\ODataMetadata\Library\Annotations;
5
6
7
use AlgoWeb\ODataMetadata\Interfaces\Annotations\IPropertyValueBinding;
8
use AlgoWeb\ODataMetadata\Interfaces\Expressions\IExpression;
9
use AlgoWeb\ODataMetadata\Interfaces\IProperty;
10
use AlgoWeb\ODataMetadata\Library\EdmElement;
11
12
/**
13
 * Represents a property binding specified as part of an EDM type annotation.
14
 *
15
 * @package AlgoWeb\ODataMetadata\Library\Annotations
16
 */
17
class EdmPropertyValueBinding extends EdmElement implements IPropertyValueBinding
18
{
19
    /**
20
     * @var IProperty
21
     */
22
    private $boundProperty;
23
    /**
24
     * @var IExpression
25
     */
26
    private $value;
27
28
    /**
29
     * Initializes a new instance of the EdmPropertyValueBinding class.
30
     * @param IProperty $boundProperty Property that is given a value by the annotation.
31
     * @param IExpression $value Expression producing the value of the annotation.
32
     */
33
    public function __construct(IProperty $boundProperty, IExpression $value)
34
    {
35
        $this->boundProperty = $boundProperty;
36
        $this->value = $value;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function getBoundProperty(): IProperty
43
    {
44
        return $this->boundProperty;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function getValue(): IExpression
51
    {
52
        return $this->value;
53
    }
54
}