GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Day::getTimePeriods()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Sourcebox\OpeningHours;
5
6
/**
7
 * Class Day
8
 * @package Sourcebox\OpeningHours
9
 */
10
class Day
11
{
12
    const MONDAY = 1;
13
    const TUESDAY = 2;
14
    const WEDNESDAY = 3;
15
    const THURSDAY = 4;
16
    const FRIDAY = 5;
17
    const SATURDAY = 6;
18
    const SUNDAY = 7;
19
20
    /**
21
     * @var int
22
     */
23
    private $number;
24
25
    /**
26
     * @var TimePeriod[]
27
     */
28
    private $timePeriods = [];
29
30 56
    public function __construct(int $number, array $timePeriods)
31
    {
32 56
        $this->setNumber($number);
33 56
        $this->setTimePeriods($timePeriods);
34 56
    }
35
36
    /**
37
     * @return int
38
     */
39 54
    public function getNumber(): int
40
    {
41 54
        return $this->number;
42
    }
43
44
    /**
45
     * @param int $number
46
     * @return Day
47
     */
48 56
    public function setNumber(int $number): Day
49
    {
50 56
        $this->number = $number;
51
52 56
        return $this;
53
    }
54
55
    /**
56
     * @return TimePeriod[]
57
     */
58 26
    public function getTimePeriods() : array
59
    {
60 26
        return $this->timePeriods;
61
    }
62
63
    /**
64
     * @param TimePeriod[] $timePeriods
65
     * @return Day
66
     */
67 56
    public function setTimePeriods(array $timePeriods) : Day
68
    {
69 56
        $this->timePeriods = $timePeriods;
70
71 56
        return $this;
72
    }
73
74
    /**
75
     * @param TimePeriod $timePeriod
76
     *
77
     * @return Day
78
     */
79 2
    public function addTimePeriod(TimePeriod $timePeriod) : Day
80
    {
81 2
        $this->timePeriods[] = $timePeriod;
82
83 2
        return $this;
84
    }
85
}
86