Passed
Push — master ( f0feee...3c09de )
by Sergei
12:22
created

Between::getMinValue()   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
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Data\Reader\Filter;
6
7
use DateTimeInterface;
8
use Yiisoft\Data\Reader\FilterInterface;
9
10
/**
11
 * `Between` filter defines a criteria so the value of the field with a given name
12
 * is between the minimal value and the maximal value.
13
 */
14
final class Between implements FilterInterface
15
{
16
    /**
17
     * @param string $field Name of the field to compare.
18
     * @param bool|DateTimeInterface|float|int|string $minValue Minimal field value.
19
     * @param bool|DateTimeInterface|float|int|string $maxValue Maximal field value.
20
     */
21 6
    public function __construct(
22
        private readonly string $field,
23
        private readonly bool|DateTimeInterface|float|int|string $minValue,
24
        private readonly bool|DateTimeInterface|float|int|string $maxValue
25
    ) {
26 6
    }
27
28 11
    public function getField(): string
29
    {
30 11
        return $this->field;
31
    }
32
33 11
    public function getMinValue(): float|DateTimeInterface|bool|int|string
34
    {
35 11
        return $this->minValue;
36
    }
37
38 11
    public function getMaxValue(): float|DateTimeInterface|bool|int|string
39
    {
40 11
        return $this->maxValue;
41
    }
42
}
43