Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.1755 |
Changes | 0 |
1 | <?php |
||
23 | 3 | public function getModifier(int $times = 1): string |
|
24 | { |
||
25 | 3 | if (!isset($this->parts['FREQ'])) { |
|
26 | throw new \BadMethodCallException("RecurrenceRule doesn't contains a FREQ. Not implemented yet."); |
||
27 | } |
||
28 | |||
29 | 3 | $freq = $this->parts['FREQ']; |
|
30 | |||
31 | 3 | if ('WEEKLY' === $freq) { |
|
32 | 2 | return "+$times week"; |
|
33 | } |
||
34 | 1 | if ('MONTHLY' === $freq) { |
|
35 | 1 | return "+$times month"; |
|
36 | } |
||
37 | |||
38 | throw new \BadMethodCallException("Unknown freq $freq"); |
||
39 | } |
||
40 | |||
59 |