YearWeekUtil   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 14
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrentCalendarWeek() 0 5 1
A getNextCalendarWeek() 0 5 1
1
<?php
2
/**
3
 * Created by IntelliJ IDEA.
4
 * User: uni
5
 * Date: 22.11.17
6
 * Time: 19:16
7
 */
8
9
namespace JPBernius\FMeat\Utilities;
10
11
use JPBernius\FMeat\Entities\CalendarWeek;
12
13
class YearWeekUtil
14
{
15
    public function getCurrentCalendarWeek(): CalendarWeek {
16
        $year = intval(date('Y'));
17
        $week = intval(date('W'));
18
        return new CalendarWeek($year, $week);
19
    }
20
21
    public function getNextCalendarWeek(): CalendarWeek {
22
        $year = intval(date('Y', strtotime("+1 week")));
23
        $week = intval(date('W', strtotime("+1 week")));
24
        return new CalendarWeek($year, $week);
25
    }
26
}