Completed
Push — master ( 65906b...52eeac )
by Beniamin
03:30
created

NotBetween::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 6
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 6
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Phuria\QueryBuilder\Expression\Comparison;
4
5
use Phuria\QueryBuilder\Expression\ExpressionInterface;
6
7
/**
8
 * @author Beniamin Jonatan Šimko <[email protected]>
9
 */
10 View Code Duplication
class NotBetween implements ExpressionInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @var ExpressionInterface $wrappedExpression
14
     */
15
    private $wrappedExpression;
16
17
    /**
18
     * @var ExpressionInterface $wrappedExpression
19
     */
20
    private $from;
21
22
    /**
23
     * @var ExpressionInterface $wrappedExpression
24
     */
25
    private $to;
26
27
    /**
28
     * @param ExpressionInterface $expression
29
     * @param ExpressionInterface $from
30
     * @param ExpressionInterface $to
31
     */
32
    public function __construct(ExpressionInterface $expression, ExpressionInterface $from, ExpressionInterface $to)
33
    {
34
        $this->wrappedExpression = $expression;
35
        $this->from = $from;
36
        $this->to = $to;
37
    }
38
39
    /**
40
     * @inheritdoc
41
     */
42
    public function compile()
43
    {
44
        return $this->wrappedExpression->compile() . ' NOT BETWEEN ' . $this->from->compile() . ' AND ' . $this->to->compile();
45
    }
46
}