| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 24 | public function getDate($month = null, $year = null) |
||
| 25 | { |
||
| 26 | |||
| 27 | if (!$this->date) { |
||
| 28 | $validator = new DateValidator(['format' => 'M Y']); |
||
| 29 | if ($validator->isValid(sprintf("%s %s", $month, $year))) { |
||
| 30 | $period = new DateTime(sprintf('last day of %s %s 23:59:59', $month, $year)); |
||
| 31 | } else { |
||
| 32 | $period = new DateTime; |
||
| 33 | } |
||
| 34 | $this->date = $period; |
||
| 35 | } |
||
| 36 | |||
| 37 | return $this->date; |
||
| 38 | } |
||
| 39 | |||
| 48 |