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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isOverridden() 0 4 1
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 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