Completed
Push — master ( 2dd332...d6426f )
by steef
02:53
created

SystemEngineerDay::generate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 9

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 9
CRAP Score 2.004

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 14
loc 14
ccs 9
cts 10
cp 0.9
rs 9.4285
cc 2
eloc 9
nc 2
nop 0
crap 2.004
1
<?php
2
3
namespace Stefanius\SpecialDates\Dates;
4
5
use Stefanius\SpecialDates\SDK\AbstractSpecialDate;
6
7 View Code Duplication
class SystemEngineerDay extends AbstractSpecialDate
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...
8
{
9 3
    protected function generate()
10
    {
11 3
        $this->description = 'Systeembeheerdersdag';
12
13 3
        if ($this->year >= 2000) {
14 3
            $timestamp = strtotime('last friday', mktime(0, 0, 0, 7, 0, $this->year));
15 3
            $date = new \DateTime();
16 3
            $date->setTimestamp($timestamp);
17
18 3
            $this->setupDateTimeObjects($date);
19 3
        } else {
20
            $this->valid = false;
21
        }
22 3
    }
23
}
24