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

GroupFilter::toArray()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
ccs 5
cts 5
cp 1
crap 2
rs 10
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