Completed
Push — master ( ae829f...1d5438 )
by Laurent
23s
created
src/AppBundle/Controller/DeliveriesController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
         $etm = $this->getDoctrine()->getManager();
43 43
         $item = $this->container->getParameter('knp_paginator.page_range');
44 44
         $qbd = $etm->getRepository('AppBundle:Orders')->createQueryBuilder('o');
45
-        $qbd->where('o.delivdate <= ' . date('Y-m-d'));
45
+        $qbd->where('o.delivdate <= '.date('Y-m-d'));
46 46
         $qbd->andWhere('o.status = 1');
47 47
         
48 48
         $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item);
Please login to merge, or discard this patch.
src/AppBundle/Form/Type/SupplierType.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -43,25 +43,25 @@  discard block
 block discarded – undo
43 43
             ->add(
44 44
                 'name',
45 45
                 TextType::class,
46
-                ['label' => 'gestock.name', 'attr'  => ['class' => 'form-control',],]
46
+                ['label' => 'gestock.name', 'attr'  => ['class' => 'form-control', ], ]
47 47
             )
48 48
             ->add(
49 49
                 'address',
50 50
                 TextType::class,
51 51
                 array(
52 52
                     'label' => 'gestock.address',
53
-                    'attr'  => ['placeholder' => 'gestock.address', 'class' => 'form-control',],
53
+                    'attr'  => ['placeholder' => 'gestock.address', 'class' => 'form-control', ],
54 54
                 )
55 55
             )
56 56
             ->add(
57 57
                 'zipcode',
58 58
                 TextType::class,
59
-                ['attr'  => ['placeholder' => 'gestock.zipcode', 'class' => 'form-control half',],]
59
+                ['attr'  => ['placeholder' => 'gestock.zipcode', 'class' => 'form-control half', ], ]
60 60
             )
61 61
             ->add(
62 62
                 'town',
63 63
                 TextType::class,
64
-                ['attr'  => ['placeholder' => 'gestock.town', 'class' => 'form-control half',],]
64
+                ['attr'  => ['placeholder' => 'gestock.town', 'class' => 'form-control half', ], ]
65 65
             )
66 66
             ->add(
67 67
                 'phone',
@@ -70,8 +70,8 @@  discard block
 block discarded – undo
70 70
                     'default_region' => 'FR',
71 71
                     'format' => PhoneNumberFormat::NATIONAL,
72 72
                     'widget' => PhoneNumberType::WIDGET_COUNTRY_CHOICE,
73
-                    'country_choices' => ['FR', 'GB', 'DE', 'IT',],
74
-                    'preferred_country_choices' => ['FR',],
73
+                    'country_choices' => ['FR', 'GB', 'DE', 'IT', ],
74
+                    'preferred_country_choices' => ['FR', ],
75 75
                     'label' => 'gestock.phone',
76 76
                 )
77 77
             )
@@ -82,21 +82,21 @@  discard block
 block discarded – undo
82 82
                     'default_region' => 'FR',
83 83
                     'format' => PhoneNumberFormat::NATIONAL,
84 84
                     'widget' => PhoneNumberType::WIDGET_COUNTRY_CHOICE,
85
-                    'country_choices' => ['FR', 'GB', 'DE', 'IT',],
86
-                    'preferred_country_choices' => ['FR',],
85
+                    'country_choices' => ['FR', 'GB', 'DE', 'IT', ],
86
+                    'preferred_country_choices' => ['FR', ],
87 87
                     'label' => 'gestock.fax',
88
-                    'attr'  => ['class' => 'form-control',]
88
+                    'attr'  => ['class' => 'form-control', ]
89 89
                 )
90 90
             )
91 91
             ->add(
92 92
                 'mail',
93 93
                 EmailType::class,
94
-                ['label' => 'gestock.mail', 'attr'  => ['class' => 'form-control',]]
94
+                ['label' => 'gestock.mail', 'attr'  => ['class' => 'form-control', ]]
95 95
             )
96 96
             ->add(
97 97
                 'contact',
98 98
                 TextType::class,
99
-                ['label' => 'gestock.contact', 'attr'  => ['class' => 'form-control',],]
99
+                ['label' => 'gestock.contact', 'attr'  => ['class' => 'form-control', ], ]
100 100
             )
101 101
             ->add(
102 102
                 'gsm',
@@ -105,10 +105,10 @@  discard block
 block discarded – undo
105 105
                     'default_region' => 'FR',
106 106
                     'format' => PhoneNumberFormat::NATIONAL,
107 107
                     'widget' => PhoneNumberType::WIDGET_COUNTRY_CHOICE,
108
-                    'country_choices' => ['FR', 'GB', 'DE', 'IT',],
109
-                    'preferred_country_choices' => ['FR',],
108
+                    'country_choices' => ['FR', 'GB', 'DE', 'IT', ],
109
+                    'preferred_country_choices' => ['FR', ],
110 110
                     'label' => 'gestock.gsm',
111
-                    'attr'  => ['class' => 'form-control',]
111
+                    'attr'  => ['class' => 'form-control', ]
112 112
                 )
113 113
             )
114 114
             /**
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
                 'delaydeliv',
120 120
                 ChoiceType::class,
121 121
                 array(
122
-                    'choices' => ['form.atob' => 1, 'form.atoc' => 2, 'form.atod' => 3, 'form.atoe' => 4,],
122
+                    'choices' => ['form.atob' => 1, 'form.atoc' => 2, 'form.atod' => 3, 'form.atoe' => 4, ],
123 123
                     'choices_as_values' => true,
124 124
                     'label' => 'settings.delay',
125 125
                     'translation_domain' => 'gs_suppliers',
126
-                    'attr'  => ['class' => 'form-control half',]
126
+                    'attr'  => ['class' => 'form-control half', ]
127 127
                 )
128 128
             )
129 129
             /**
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     'choice_translation_domain' => true,
148 148
                     'translation_domain' => 'messages',
149 149
                     'label' => 'day_order',
150
-                    'attr'  => ['class' => 'form-control',],
150
+                    'attr'  => ['class' => 'form-control', ],
151 151
                     'expanded' => true,
152 152
                     'multiple' => true,
153 153
                 )
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                 EntityType::class,
158 158
                 array(
159 159
                     'class' => 'AppBundle:FamilyLog',
160
-                    'query_builder' => function (EntityRepository $er) {
160
+                    'query_builder' => function(EntityRepository $er) {
161 161
                         return $er->createQueryBuilder('f')
162 162
                             ->orderBy('f.path', 'ASC');
163 163
                     },
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
                     'placeholder' => 'gestock.settings.diverse.choice_family',
167 167
                     'empty_data' => null,
168 168
                     'label' => 'gestock.settings.diverse.familylog',
169
-                    'attr'  => ['class' => 'form-control half',]
169
+                    'attr'  => ['class' => 'form-control half', ]
170 170
                 )
171 171
             )
172
-            ->add('active', HiddenType::class, ['data' => true,]);
172
+            ->add('active', HiddenType::class, ['data' => true, ]);
173 173
     }
174 174
 
175 175
     /**
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function configureOptions(OptionsResolver $resolver)
179 179
     {
180
-        $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Supplier',]);
180
+        $resolver->setDefaults(['data_class' => 'AppBundle\Entity\Supplier', ]);
181 181
     }
182 182
 
183 183
     /**
Please login to merge, or discard this patch.
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.