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