| Conditions | 5 |
| Paths | 5 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 5.9256 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 59 | 4 | private function readyToRecordNextEntry($today) |
|
| 60 | { |
||
| 61 | 4 | switch ($this->duty->cycle) { |
|
| 62 | 4 | case 'daily': |
|
| 63 | 1 | $this->recordNextEntry(); |
|
| 64 | 1 | break; |
|
| 65 | 3 | case 'monthly': |
|
| 66 | if (Carbon::today()->startOfMonth()->format('Y-m-d') == $today) { |
||
| 67 | $this->recordNextEntry(); |
||
| 68 | } |
||
| 69 | break; |
||
| 70 | default: //weekly |
||
| 71 | 3 | if (Carbon::today()->startOfWeek()->format('Y-m-d') == $today) { |
|
| 72 | $this->recordNextEntry(); |
||
| 73 | } |
||
| 74 | } |
||
| 75 | 4 | } |
|
| 76 | } |
||
| 77 |