| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.0416 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 3 | public function getLastEvent(\DateTimeImmutable $firstEventStartAt): \DateTimeImmutable |
|
| 42 | { |
||
| 43 | 3 | if (isset($this->parts['UNTIL'])) { |
|
| 44 | 1 | return new \DateTimeImmutable($this->parts['UNTIL']); |
|
| 45 | } |
||
| 46 | |||
| 47 | 3 | if (isset($this->parts['COUNT'])) { |
|
| 48 | 3 | return $firstEventStartAt->modify($this->getModifier((int) $this->parts['COUNT'])); |
|
| 49 | } |
||
| 50 | |||
| 51 | throw new \BadMethodCallException('Not implemented recurring rule.'); |
||
| 52 | } |
||
| 53 | } |
||
| 54 |