| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0987 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | 4 | private function getMondayThisWeek(\DateTime $date) |
|
| 40 | { |
||
| 41 | 4 | $monday = clone $date; |
|
| 42 | |||
| 43 | 4 | if ($monday->format('N') != 1) { |
|
| 44 | 2 | $monday->modify('Monday this week'); |
|
| 45 | |||
| 46 | 2 | if ($date->format('Y W') != $monday->format('Y W')) { |
|
| 47 | $monday->modify('-7 day'); |
||
| 48 | } |
||
| 49 | 2 | } |
|
| 50 | |||
| 51 | 4 | return $monday; |
|
| 52 | } |
||
| 53 | |||
| 70 |