| Conditions | 4 |
| Paths | 6 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | public function __construct($interval = 'month', $count = 1, $start = '') |
||
| 49 | { |
||
| 50 | if (empty($start)) { |
||
| 51 | $this->start = now(); |
||
| 52 | } elseif (! $start instanceof Carbon) { |
||
| 53 | $this->start = new Carbon($start); |
||
| 54 | } else { |
||
| 55 | $this->start = $start; |
||
| 56 | } |
||
| 57 | |||
| 58 | if ($count > 0) { |
||
| 59 | $this->period = $count; |
||
| 60 | } |
||
| 61 | |||
| 62 | $start = clone $this->start; |
||
| 63 | $method = 'add'.ucfirst($this->interval).'s'; |
||
| 64 | $this->end = $start->$method($this->period); |
||
| 65 | } |
||
| 66 | |||
| 107 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.