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.

DateOverride::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
declare(strict_types=1);
3
4
namespace Sourcebox\OpeningHours\Override;
5
6
/**
7
 * Class DateOverride
8
 * @package Sourcebox\OpeningHours\Override
9
 */
10
class DateOverride implements OverrideInterface
11
{
12
    /**
13
     * @var \DateTime
14
     */
15
    public $holidayDateTime;
16
17
    /**
18
     * @var string
19
     */
20
    private $type;
21
22
    /**
23
     * DateOverride constructor.
24
     * @param $holidayDateTime
25
     */
26 16
    public function __construct(\DateTime $holidayDateTime)
27
    {
28 16
        $this->holidayDateTime = $holidayDateTime;
29 16
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 14
    public function isOverridden(\DateTime $dateTime) : bool
35
    {
36 14
        return $dateTime->format('Y-m-d') === $this->holidayDateTime->format('Y-m-d');
37
    }
38
39
    /**
40
     * Returns the type of override.
41
     *
42
     * @return string
43
     */
44 10
    public function getType() : string
45
    {
46 10
        return $this->type;
47
    }
48
49
    /**
50
     * @param string $type
51
     */
52 14
    public function setType(string $type)
53
    {
54 14
        $this->type = $type;
55 14
    }
56
}
57