Between   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 27
ccs 8
cts 8
cp 1
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getMaxValue() 0 3 1
A getField() 0 3 1
A getMinValue() 0 3 1
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