Passed
Push — master ( 0d6e2c...9c3ed2 )
by Alexander
01:27
created

GroupFilter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A toArray() 0 7 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Yiisoft\Data\Reader\Filter;
5
6
abstract class GroupFilter implements FilterInterface
7
{
8
    /**
9
     * @var FilterInterface[]
10
     */
11
    private $filters;
12
13 2
    public function __construct(FilterInterface...$filters)
14
    {
15 2
        $this->filters = $filters;
16 2
    }
17
18 5
    public function toArray(): array
19
    {
20 5
        $filtersArray = [];
21 5
        foreach ($this->filters as $filter) {
22 5
            $filtersArray[] = $filter->toArray();
23
        }
24 5
        return [static::getOperator(), $filtersArray];
25
    }
26
}
27