Passed
Pull Request — master (#173)
by
unknown
12:58
created

ILike   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 3
c 1
b 1
f 0
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getField() 0 3 1
A getValue() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Data\Reader\Filter;
6
7
use Yiisoft\Data\Reader\FilterInterface;
8
9
/**
10
 * `ILike` filter defines a criteria for ensuring field value is like-match to a given value (case-insensitive).
11
 */
12
final class ILike implements FilterInterface
13
{
14
    /**
15
     * @param string $field Name of the field to compare.
16
     * @param string $value Value to like-compare with.
17
     */
18 6
    public function __construct(
19
        private readonly string $field,
20
        private readonly string $value,
21
    ) {
22 6
    }
23
24 6
    public function getField(): string
25
    {
26 6
        return $this->field;
27
    }
28
29 5
    public function getValue(): string
30
    {
31 5
        return $this->value;
32
    }
33
}
34