Completed
Pull Request — master (#7)
by steef
21:53 queued 07:16
created

RefugeeDay::generate()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2.0116

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 7
cp 0.8571
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 0
crap 2.0116
1
<?php
2
3
namespace Stefanius\SpecialDates\Dates;
4
5
use Stefanius\SpecialDates\SDK\AbstractSpecialDate;
6
7
class RefugeeDay extends AbstractSpecialDate
8
{
9 3
    protected function generate()
10
    {
11 3
        $this->description = 'Wereldvluchtelingendag';
12
13 3
        if ($this->year >= 2000) {
14 3
            $this->setupDateTimeObjects($this->generateDateTime($this->year, 6, 20));
15 3
            $this->valid = true;
16
        } else {
17
            $this->valid = false;
18
        }
19 3
    }
20
}
21