Condition   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 61
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getValueIdentifier() 0 3 1
A getValueCompare() 0 3 1
A getOperator() 0 3 1
A __construct() 0 8 1
A setValueCompare() 0 5 1
A setValueIdentifier() 0 5 1
A setOperator() 0 5 1
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