Failed Conditions
Pull Request — master (#7184)
by
unknown
37:23
created

Between::__toString()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
crap 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
0 ignored issues
show
introduced by
Method \Doctrine\ORM\Query\Expr\Between::__construct() has useless @param annotation for parameter $operator.
Loading history...
27
     * @param int|string $key
28
     * @param int|string $min
29
     * @param int|string $max
30
     */
31 1
    public function __construct(string $operator, $key, $min, $max)
32
    {
33 1
        $this->operator = $operator;
34 1
        $this->key      = $key;
35 1
        $this->min      = $min;
36 1
        $this->max      = $max;
37 1
    }
38
39 1
    public function __toString() : string
40
    {
41 1
        return $this->key . ' ' . $this->operator . ' ' . $this->min . ' AND ' . $this->max;
42
    }
43
}
44