__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
namespace Xiag\Rql\Parser\NodeParser\Query;
3
4
use Xiag\Rql\Parser\NodeParserInterface;
5
use Xiag\Rql\Parser\SubParserInterface;
6
use Xiag\Rql\Parser\Node\Query\AbstractComparisonOperatorNode;
7
8
abstract class AbstractComparisonOperatorNodeParser implements NodeParserInterface
9
{
10
    /**
11
     * @var SubParserInterface
12
     */
13
    protected $fieldNameParser;
14
    /**
15
     * @var SubParserInterface
16
     */
17
    protected $valueParser;
18
19
    /**
20
     * @param SubParserInterface $fieldNameParser
21
     * @param SubParserInterface $valueParser
22
     */
23 64
    public function __construct(SubParserInterface $fieldNameParser, SubParserInterface $valueParser)
24
    {
25 64
        $this->fieldNameParser = $fieldNameParser;
26 64
        $this->valueParser = $valueParser;
27 64
    }
28
29
    /**
30
     * @param string $field
31
     * @param mixed $value
32
     * @return AbstractComparisonOperatorNode
33
     */
34
    abstract protected function createNode($field, $value);
35
36
    /**
37
     * @return string
38
     */
39
    abstract protected function getOperatorName();
40
}
41