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

Like   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 20
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
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
 * `Like` filter defines a criteria for ensuring field value is like-match to a given value.
11
 */
12
final class Like 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