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

Like::toCriteriaArray()   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 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