| Conditions | 4 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function parse($rRule) |
||
| 25 | { |
||
| 26 | if (empty($rRule)) { |
||
| 27 | throw new \InvalidArgumentException('Empty RRULE'); |
||
| 28 | } |
||
| 29 | |||
| 30 | $recurrence = new Recurrence(); |
||
| 31 | |||
| 32 | $recurrence->setFrequency($this->freqTransformer->transform($rRule)); |
||
| 33 | |||
| 34 | if ($periodStartAt = $this->dtStartTransformer->transform($rRule)) { |
||
| 35 | $recurrence->setPeriodStartAt($periodStartAt); |
||
| 36 | } |
||
| 37 | |||
| 38 | if ($periodStartAt = $this->untilTransformer->transform($rRule)) { |
||
| 39 | $recurrence->setPeriodEndAt($periodStartAt); |
||
| 40 | } |
||
| 41 | |||
| 42 | return $recurrence; |
||
| 43 | } |
||
| 44 | |||
| 45 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: