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

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