WhitMonday::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 10
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 HansOtt\Holiday\Calendar\Year;
6
use HansOtt\Holiday\HolidayAbstract;
7
8 View Code Duplication
final class WhitMonday extends HolidayAbstract
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10 2
    public function __construct(Year $year)
11
    {
12 2
        $easterMonday = \HansOtt\Holiday\getEasterMonday($year);
13 2
        $startsAt = $easterMonday->modify('+51 days');
14
15 2
        parent::__construct(
16 2
            $startsAt,
17 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...
18 2
        );
19 2
    }
20
21 2
    public function isOfficial()
22
    {
23 2
        return true;
24
    }
25
}
26