Completed
Push — master ( 175b65...c73746 )
by Alex
18s queued 15s
created

EdmPropertyConstructor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

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

3 Methods

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