Futuristic::isLeapYear()   B
last analyzed

Complexity

Conditions 6
Paths 11

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 6
eloc 3
nc 11
nop 1
dl 0
loc 5
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace Popy\Calendar\Converter\LeapYearCalculator;
4
5
use Popy\Calendar\Converter\SimpleLeapYearCalculatorInterface;
6
7
/**
8
 * Futuristic leap day implementation, more precise than the modern one,
9
 * but not officially used.
10
 */
11
class Futuristic implements SimpleLeapYearCalculatorInterface
12
{
13
    /**
14
     * @inheritDoc
15
     */
16
    public function isLeapYear($year)
17
    {
18
        return !($year % 4) && ($year % 100)
19
            || !($year % 400) && ($year % 2000)
20
            || !($year % 4000) && ($year % 20000)
21
        ;
22
    }
23
}
24