@@ -30,19 +30,19 @@ discard block |
||
| 30 | 30 | private function getEaster($pYear = null) |
| 31 | 31 | { |
| 32 | 32 | if (is_null($pYear)) { |
| 33 | - $pYear = (int)date('Y'); |
|
| 33 | + $pYear = (int) date('Y'); |
|
| 34 | 34 | } |
| 35 | 35 | $nDate = $pYear - 1900; |
| 36 | - $pAa = $nDate%19; |
|
| 37 | - $pBb = floor(((7*$pAa)+1)/19); |
|
| 38 | - $pCc = ((11*$pAa)-$pBb+4)%29; |
|
| 39 | - $pDd = floor($nDate/4); |
|
| 40 | - $pEe = ($nDate-$pCc+$pDd+31)%7; |
|
| 41 | - $pResult = 25-$pCc-$pEe; |
|
| 36 | + $pAa = $nDate % 19; |
|
| 37 | + $pBb = floor(((7 * $pAa) + 1) / 19); |
|
| 38 | + $pCc = ((11 * $pAa) - $pBb + 4) % 29; |
|
| 39 | + $pDd = floor($nDate / 4); |
|
| 40 | + $pEe = ($nDate - $pCc + $pDd + 31) % 7; |
|
| 41 | + $pResult = 25 - $pCc - $pEe; |
|
| 42 | 42 | if ($pResult > 0) { |
| 43 | 43 | $pEaster = strtotime($pYear.'/04/'.$pResult); |
| 44 | 44 | } else { |
| 45 | - $pEaster = strtotime($pYear.'/03/'.(31+$pResult)); |
|
| 45 | + $pEaster = strtotime($pYear.'/03/'.(31 + $pResult)); |
|
| 46 | 46 | } |
| 47 | 47 | return $pEaster; |
| 48 | 48 | } |
@@ -61,21 +61,21 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | $aBankHolidays = ['1_1', '1_5', '8_5', '14_7', '15_8', '1_11', '11_11', '25_12', ]; |
| 63 | 63 | if (function_exists('easter_date')) { |
| 64 | - $pEaster = easter_date((int)date('Y', $pDate)); |
|
| 64 | + $pEaster = easter_date((int) date('Y', $pDate)); |
|
| 65 | 65 | } else { |
| 66 | - $pEaster = $this->getEaster((int)date('Y', $pDate)); |
|
| 66 | + $pEaster = $this->getEaster((int) date('Y', $pDate)); |
|
| 67 | 67 | } |
| 68 | 68 | $aBankHolidays[] = date('j_n', $pEaster); |
| 69 | - $aBankHolidays[] = date('j_n', $pEaster + (86400*39)); |
|
| 70 | - $aBankHolidays[] = date('j_n', $pEaster + (86400*49)); |
|
| 69 | + $aBankHolidays[] = date('j_n', $pEaster + (86400 * 39)); |
|
| 70 | + $aBankHolidays[] = date('j_n', $pEaster + (86400 * 49)); |
|
| 71 | 71 | |
| 72 | 72 | $pEnd = $pDays * 86400; |
| 73 | 73 | $idn = 0; |
| 74 | 74 | while ($idn < $pEnd) { |
| 75 | 75 | $idn = strtotime('+1 day', $idn); |
| 76 | - if (in_array(date('w', $pDate+$idn), array(0, 6)) || in_array(date('j_n', $pDate+$idn), $aBankHolidays)) { |
|
| 76 | + if (in_array(date('w', $pDate + $idn), array(0, 6)) || in_array(date('j_n', $pDate + $idn), $aBankHolidays)) { |
|
| 77 | 77 | $pEnd = strtotime('+1 day', $pEnd); |
| 78 | - $pDays ++; |
|
| 78 | + $pDays++; |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | return $pDays; |