| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | public function __construct($interval = 'month', $count = 1, $start = '') |
||
| 49 | { |
||
| 50 | $this->interval = $interval; |
||
| 51 | |||
| 52 | if (empty($start)) { |
||
| 53 | $this->start = Carbon::now(); |
||
| 54 | } elseif (! $start instanceof Carbon) { |
||
| 55 | $this->start = new Carbon($start); |
||
| 56 | } else { |
||
| 57 | $this->start = $start; |
||
| 58 | } |
||
| 59 | |||
| 60 | $this->period = $count; |
||
| 61 | $start = clone $this->start; |
||
| 62 | $method = 'add'.ucfirst($this->interval).'s'; |
||
| 63 | $this->end = $start->{$method}($this->period); |
||
| 64 | } |
||
| 65 | |||
| 106 |
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.