Conditions | 3 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | 6 | public function setFilter($filter) |
|
36 | { |
||
37 | 6 | if (is_array($filter)) { |
|
38 | 5 | $filter = new Filter($filter); |
|
39 | } |
||
40 | |||
41 | 5 | if ($filter instanceof Filter) { |
|
42 | 4 | $this->filter = $filter; |
|
43 | |||
44 | 4 | return $this; |
|
45 | } |
||
46 | |||
47 | 1 | throw new InvalidArgumentException('The filter must be an instance of '.Filter::class.' or a keyed array'); |
|
48 | } |
||
50 |