Passed
Push — master ( 1f27ac...52075a )
by Alexander
04:53 queued 02:24
created

Not   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getOperator() 0 3 1
A __construct() 0 2 1
A toCriteriaArray() 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
 * `Not` filter negates another filter.
11
 */
12
final class Not implements FilterInterface
13
{
14
    /**
15
     * @param FilterInterface $filter Filter to negate.
16
     */
17 2
    public function __construct(private FilterInterface $filter)
18
    {
19 2
    }
20
21 2
    public function toCriteriaArray(): array
22
    {
23 2
        return [self::getOperator(), $this->filter->toCriteriaArray()];
24
    }
25
26 105
    public static function getOperator(): string
27
    {
28 105
        return 'not';
29
    }
30
}
31