Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
26 | 3 | public function create(string $filterName, string $value): FilterInterface |
|
27 | { |
||
28 | 3 | switch ($filterName) { |
|
29 | 3 | case 'from': |
|
30 | 1 | return new FromYearFilter(new YearFilterValidator(), $value); |
|
31 | 2 | case 'to': |
|
32 | 1 | return new ToYearFilter(new YearFilterValidator(), $value); |
|
33 | default: |
||
34 | 1 | throw new NoSuchFilterException('Chosen filter implementation doesn\'t exist'); |
|
35 | |||
39 |