AbstractSingleCompare   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
eloc 12
dl 0
loc 41
c 0
b 0
f 0
ccs 16
cts 16
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRight() 0 3 1
A getLeft() 0 3 1
A accept() 0 3 1
A update() 0 8 3
1
<?php
2
3
namespace Xsolve\SalesforceClient\QueryBuilder\Expr\Compare;
4
5
use Xsolve\SalesforceClient\QueryBuilder\Visitor\VisitorInterface;
6
7
abstract class AbstractSingleCompare extends AbstractCompare
8
{
9
    /**
10
     * @var string
11
     */
12
    private $left;
13
14
    /**
15
     * @var string
16
     */
17
    private $right;
18
19 8
    public function __construct(string $left, string $right)
20
    {
21 8
        $this->left = $left;
22 8
        $this->right = $right;
23 8
    }
24
25 29
    public function getLeft(): string
26
    {
27 29
        return $this->left;
28
    }
29
30 29
    public function getRight(): string
31
    {
32 29
        return $this->right;
33
    }
34
35 15
    public function accept(VisitorInterface $visitor)
36
    {
37 15
        $visitor->visitSingleCompare($this);
38 15
    }
39
40 15
    public function update(array $values)
41
    {
42 15
        if (isset($values['left'])) {
43 15
            $this->left = $values['left'];
44
        }
45
46 15
        if (isset($values['right'])) {
47 15
            $this->right = $values['right'];
48
        }
49 15
    }
50
}
51