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.
Completed
Push — master ( 7e6465...50bb24 )
by Kevin
02:32
created

OpeningHourChecker::isClosedOn()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Sourcebox\OpeningHours\Checker;
4
5
use Sourcebox\OpeningHours\Override\OverrideInterface;
6
7
/**
8
 * Class OpeningHourChecker
9
 * @package Sourcebox\TimeTable
10
 */
11
class OpeningHourChecker extends TimeTableChecker
12
{
13
    /**
14
     * Checks the time table whether there are opening time periods
15
     * for the given day.
16
     *
17
     * @param $dayId
18
     *
19
     * @return bool
20
     */
21 4
    public function isOpenOn($dayId) : bool
22
    {
23 4
        return count($this->getTimePeriodsForDay($dayId)) > 0;
24
    }
25
26
    /**
27
     * Checks the time table whether there are no opening time periods
28
     * for the given day.
29
     *
30
     * @param $dayName
31
     * @return bool
32
     */
33 2
    public function isClosedOn($dayName)
34
    {
35 2
        return !$this->isOpenOn($dayName);
36
    }
37
38
    /**
39
     * Checks time table for open time periods on a certain date and time.
40
     *
41
     * @param \DateTime $dateTime
42
     * @return bool
43
     */
44 44
    public function isOpenAt(\DateTime $dateTime) : bool
45
    {
46 44
        if ($this->isOverridden($dateTime, OverrideInterface::TYPE_EXCLUDE)) {
47 24
            return false;
48 22
        } elseif ($this->isOverridden($dateTime, OverrideInterface::TYPE_INCLUDE)) {
49 2
            return true;
50
        }
51
52 20
        return $this->isDateTimeWithinDayTimePeriods($dateTime);
53
    }
54
55
    /**
56
     * Checks time table if there are no open time periods on a certain date and time.
57
     * @param \DateTime $dateTime
58
     * @return bool
59
     */
60 14
    public function isClosedAt(\DateTime $dateTime) : bool
61
    {
62 14
        return !$this->isOpenAt($dateTime);
63
    }
64
}
65