Failed Conditions
Pull Request — master (#7184)
by
unknown
07:12
created

Between   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\ORM\Query\Expr;
6
7
final class Between
8
{
9
    public const NOT_BETWEEN = 'NOT BETWEEN';
10
11
    public const BETWEEN = 'BETWEEN';
12
13
    /** @var string */
14
    private $operator;
15
16
    /** @var int|string */
17
    private $key;
18
19
    /** @var int|string */
20
    private $min;
21
22
    /** @var int|string */
23
    private $max;
24
25
    /**
26
     * @param string     $operator
27
     * @param int|string $key
28
     * @param int|string $min
29
     * @param int|string $max
30
     */
31
    public function __construct($operator, $key, $min, $max)
32
    {
33
        $this->operator = $operator;
34
        $this->key      = $key;
35
        $this->min      = $min;
36
        $this->max      = $max;
37
    }
38
39
    public function __toString() : string
40
    {
41
        return $this->key . ' ' . $this->operator . ' ' . $this->min . ' AND ' . $this->max;
42
    }
43
}
44