Conditions | 5 |
Paths | 12 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function isLeapYear($year) |
||
18 | { |
||
19 | $cycle = $year % 2820; |
||
20 | |||
21 | if ($cycle >= 21 * 128) { |
||
22 | $cycle -= 21 * 128; |
||
23 | } else { |
||
24 | $cycle = $cycle % 128; |
||
25 | } |
||
26 | |||
27 | if ($cycle >= 29) { |
||
28 | $cycle -= 29; |
||
29 | if ($cycle >= 2*33) { |
||
30 | $cycle -= 2 * 33; |
||
31 | } else { |
||
32 | $cycle = $cycle % 33; |
||
33 | } |
||
34 | } |
||
35 | |||
36 | $cycle++; |
||
37 | |||
38 | return $cycle > 1 && ($cycle % 4 === 1); |
||
39 | } |
||
41 |