Condition::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 3
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Copyright © Thomas Klein, All rights reserved.
4
 * See LICENSE bundled with this library for license details.
5
 */
6
declare(strict_types=1);
7
8
namespace LogicTree\Node;
9
10
final class Condition extends AbstractNode implements ConditionInterface
11
{
12
    /**
13
     * @var string
14
     */
15
    private $operator;
16
17
    /**
18
     * @var string
19
     */
20
    private $valueIdentifier;
21
22
    /**
23
     * @var mixed
24
     */
25
    private $valueCompare;
26
27
    public function __construct(
28
        string $valueIdentifier,
29
        string $operator,
30
        $valueCompare
31
    ) {
32
        $this->setValueIdentifier($valueIdentifier);
33
        $this->setOperator($operator);
34
        $this->setValueCompare($valueCompare);
35
    }
36
37
    public function getOperator(): string
38
    {
39
        return $this->operator;
40
    }
41
42
    public function setOperator(string $operator): ConditionInterface
43
    {
44
        $this->operator = $operator;
45
46
        return $this;
47
    }
48
49
    public function getValueIdentifier(): string
50
    {
51
        return $this->valueIdentifier;
52
    }
53
54
    public function setValueIdentifier(string $identifier): ConditionInterface
55
    {
56
        $this->valueIdentifier = $identifier;
57
58
        return $this;
59
    }
60
61
    public function getValueCompare()
62
    {
63
        return $this->valueCompare;
64
    }
65
66
    public function setValueCompare($value): ConditionInterface
67
    {
68
        $this->valueCompare = $value;
69
70
        return $this;
71
    }
72
}
73