Completed
Push — Order ( 92abe2...873622 )
by Laurent
03:32
created
src/AppBundle/Helper/TimeHelper.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      * get Easter date.
26 26
      *
27 27
      * @param integer $pYear
28
-     * @return timestamp
28
+     * @return integer
29 29
      */
30 30
     private function getEaster($pYear = null)
31 31
     {
Please login to merge, or discard this 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,21 +61,21 @@  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 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;
Please login to merge, or discard this patch.
src/AppBundle/Controller/OrdersController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
 
116 116
         $orders = new Orders();
117 117
         $form = $this->createForm(OrdersType::class, $orders);
118
-        $return = ['orders' => $orders, 'form' => $form->createView(),];
118
+        $return = ['orders' => $orders, 'form' => $form->createView(), ];
119 119
         $form->handleRequest($request);
120 120
         $supplier = $orders->getSupplier();
121 121
         $articles = $etm->getRepository('AppBundle:Article')->getArticleFromSupplier($supplier->getId());
Please login to merge, or discard this patch.