AssumptionOfMary::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 0
loc 10
ccs 8
cts 8
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace HansOtt\Holiday\Calendar\Belgium;
4
5
use DateTimeImmutable;
6
use HansOtt\Holiday\Calendar\Year;
7
use HansOtt\Holiday\HolidayAbstract;
8
9
final class AssumptionOfMary extends HolidayAbstract
10
{
11 2
    public function __construct(Year $year)
12
    {
13 2
        $time = sprintf('%s-08-15', $year);
14 2
        $startsAt = new DateTimeImmutable($time);
15
16 2
        parent::__construct(
17 2
            $startsAt,
18 2
            \HansOtt\Holiday\getEndOfDay($startsAt)
0 ignored issues
show
Security Bug introduced by
It seems like \HansOtt\Holiday\getEndOfDay($startsAt) targeting HansOtt\Holiday\getEndOfDay() can also be of type false; however, HansOtt\Holiday\HolidayAbstract::__construct() does only seem to accept object<DateTimeImmutable>, did you maybe forget to handle an error condition?
Loading history...
19 2
        );
20 2
    }
21
22 2
    public function isOfficial()
23
    {
24 2
        return true;
25
    }
26
}
27