| Total Complexity | 10 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Coverage | 81.82% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 6 | abstract class GroupFilter implements FilterInterface |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var FilterInterface[] |
||
| 10 | */ |
||
| 11 | private $filters; |
||
| 12 | |||
| 13 | 6 | public function __construct(FilterInterface...$filters) |
|
| 16 | 6 | } |
|
| 17 | |||
| 18 | 9 | public function toArray(): array |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * Building criteria with array |
||
| 32 | * |
||
| 33 | * ~~~ |
||
| 34 | * $dataReader->withFilters((new All())->withArray( |
||
| 35 | * [ |
||
| 36 | * ['>', 'id', 88], |
||
| 37 | * ['or', [ |
||
| 38 | * ['=', 'state', 2], |
||
| 39 | * ['like', 'name', 'eva'], |
||
| 40 | * ], |
||
| 41 | * ] |
||
| 42 | * )) |
||
| 43 | * ~~~ |
||
| 44 | * |
||
| 45 | * @param array $filtersArray |
||
| 46 | * @return static |
||
| 47 | */ |
||
| 48 | 4 | public function withFiltersArray(array $filtersArray) |
|
| 66 |