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

EdmAssertTypeExpression::getExpressionKind()   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\Expressions;
5
6
use AlgoWeb\ODataMetadata\Enums\ExpressionKind;
7
use AlgoWeb\ODataMetadata\Interfaces\Expressions\IAssertTypeExpression;
8
use AlgoWeb\ODataMetadata\Interfaces\Expressions\IExpression;
9
use AlgoWeb\ODataMetadata\Interfaces\ITypeReference;
10
use AlgoWeb\ODataMetadata\Library\EdmElement;
11
12
/**
13
 * Represents an EDM type assertion expression.
14
 *
15
 * @package AlgoWeb\ODataMetadata\Library\Expressions
16
 */
17
class EdmAssertTypeExpression extends EdmElement implements IAssertTypeExpression
18
{
19
    /**
20
     * @var IExpression
21
     */
22
    private $operand;
23
    /**
24
     * @var ITypeReference
25
     */
26
    private $type;
27
28
    /**
29
     * Initializes a new instance of the EdmAssertTypeExpression class.
30
     * @param IExpression $operand Expression for which the type is asserted.
31
     * @param ITypeReference $type Type to assert.
32
     */
33
    public function __construct(IExpression $operand, ITypeReference $type)
34
    {
35
        $this->operand = $operand;
36
        $this->type = $type;
37
    }
38
39
    /**
40
     * @inheritDoc
41
     */
42
    public function getOperand(): IExpression
43
    {
44
        return $this->operand;
45
    }
46
47
    /**
48
     * @inheritDoc
49
     */
50
    public function getType(): ITypeReference
51
    {
52
        return $this->type;
53
    }
54
55
    /**
56
     * @inheritDoc
57
     */
58
    public function getExpressionKind(): ExpressionKind
59
    {
60
        return ExpressionKind::AssertType();
61
    }
62
}