| Conditions | 3 |
| Paths | 3 |
| Total Lines | 21 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 5.3915 |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | 3 | protected function generate() |
|
| 10 | { |
||
| 11 | 3 | $this->description = 'Pannenkoekendag'; |
|
| 12 | |||
| 13 | 3 | if ($this->year >= 2007) { |
|
| 14 | if ($this->year === 2013) { |
||
| 15 | $this->startDate = new \DateTime('2013-03-15'); |
||
| 16 | $this->endDate = new \DateTime('2013-03-15'); |
||
| 17 | } else { |
||
| 18 | $timestamp = strtotime('last friday', mktime(0, 0, 0, 4, 0, $this->year)); |
||
| 19 | $this->startDate = new \DateTime(); |
||
| 20 | $this->startDate->setTimestamp($timestamp); |
||
| 21 | $this->endDate = new \DateTime(); |
||
| 22 | $this->endDate->setTimestamp($timestamp); |
||
| 23 | } |
||
| 24 | |||
| 25 | $this->totalLength = 1; |
||
| 26 | } else { |
||
| 27 | 3 | $this->valid = false; |
|
| 28 | } |
||
| 29 | 3 | } |
|
| 30 | } |
||
| 31 |