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.

DatePeriodOverride   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 54
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isOverridden() 0 4 2
A getType() 0 4 1
A setType() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Sourcebox\OpeningHours\Override;
5
6
/**
7
 * Class DatePeriodOverride
8
 * @package Sourcebox\TimeTable\Override
9
 */
10
class DatePeriodOverride implements OverrideInterface
11
{
12
    /**
13
     * @var \DateTime
14
     */
15
    private $startDateTime;
16
17
    /**
18
     * @var \DateTime
19
     */
20
    private $endDateTime;
21
22
    /**
23
     * @var string
24
     */
25
    private $type;
26
27
    /**
28
     * DatePeriodOverride constructor.
29
     * @param \DateTime $startDateTime
30
     * @param \DateTime $endDateTime
31
     */
32 52
    public function __construct(\DateTime $startDateTime, \DateTime $endDateTime)
33
    {
34 52
        $this->startDateTime = $startDateTime;
35 52
        $this->endDateTime = $endDateTime;
36 52
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 52
    public function isOverridden(\DateTime $dateTime) : bool
42
    {
43 52
        return $dateTime >= $this->startDateTime && $dateTime <= $this->endDateTime;
44
    }
45
46
    /**
47
     * Returns the type of override.
48
     *
49
     * @return string
50
     */
51 26
    public function getType() : string
52
    {
53 26
        return $this->type;
54
    }
55
56
    /**
57
     * @param string $type
58
     */
59 52
    public function setType(string $type)
60
    {
61 52
        $this->type = $type;
62 52
    }
63
}
64