Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
24 | public static function getMondayThisWeek(\DateTime $date) |
||
25 | { |
||
26 | $monday = clone $date; |
||
27 | |||
28 | if ($monday->format('N') != 1) { |
||
29 | $monday->modify('Monday this week'); |
||
30 | |||
31 | if ($date->format('Y W') != $monday->format('Y W')) { |
||
32 | $monday->modify('-7 day'); |
||
33 | } |
||
34 | } |
||
35 | |||
36 | return $monday; |
||
37 | } |
||
38 | |||
52 |