Test Failed
Push — master ( c78782...4767ee )
by Davis
05:32
created

DatesConfig::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace DavisPeixoto\ReportDates;
4
5
use DateTimeZone;
6
7
class DatesConfig
8
{
9
    /**
10
     * @var DateTimeZone
11
     */
12
    private $timezone;
13
14
    /**
15
     * @var DayNumber
16
     */
17
    private $weeksStartsOn;
18
19
    /**
20
     * DatesConfig constructor.
21
     *
22
     * @param DateTimeZone|null $timezone
23
     * @param DayNumber|null $weeksStartsOn
24
     */
25
    public function __construct(DateTimeZone $timezone = null, DayNumber $weeksStartsOn = null)
26
    {
27
        $this->timezone = $timezone ?? new DateTimeZone('UTC');
28
        $this->weeksStartsOn = $weeksStartsOn ?? new DayNumber(DayNumber::SUNDAY);
29
    }
30
31
    /**
32
     * @return DateTimeZone
33
     */
34
    public function getTimezone(): DateTimeZone
35
    {
36
        return $this->timezone;
37
    }
38
39
    /**
40
     * @return DayNumber
41
     */
42
    public function getWeeksStartsOn(): DayNumber
43
    {
44
        return $this->weeksStartsOn;
45
    }
46
47
48
}
49