Completed
Push — master ( a8b7ac...099705 )
by Laurent
03:14
created
src/AppBundle/Helper/TimeHelper.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
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,20 +61,20 @@  discard block
 block discarded – undo
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
-        $pEnd = strtotime('+' . $pDays . ' day', $pDate);
72
+        $pEnd = strtotime('+'.$pDays.' day', $pDate);
73 73
         $idn = 0;
74 74
         while ($idn < $pEnd) {
75 75
             if (in_array(date('w', $pEnd), array(0, 6)) || in_array(date('j_n', $pEnd), $aBankHolidays)) {
76 76
                 $pEnd = strtotime('+1 day', $pEnd);
77
-                $pDays ++;
77
+                $pDays++;
78 78
             }
79 79
             $idn = strtotime('+1 day', $idn);
80 80
         }
Please login to merge, or discard this patch.