Completed
Push — master ( 630db2...59081b )
by Laurent
03:27
created
src/AppBundle/Controller/AbstractOrdersController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         return $this->createForm(
40 40
             OrdersType::class,
41 41
             $orders,
42
-            ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'POST',]
42
+            ['attr' => ['id' => 'create'], 'action' => $this->generateUrl($route), 'method' => 'POST', ]
43 43
         );
44 44
     }
45 45
 
@@ -52,22 +52,22 @@  discard block
 block discarded – undo
52 52
      */
53 53
     protected function abstractPrintAction(Orders $orders, $from)
54 54
     {
55
-        $file = $from . '-' . $orders->getId() . '.pdf';
55
+        $file = $from.'-'.$orders->getId().'.pdf';
56 56
         $company = $this->getDoctrine()->getManager()->getRepository('AppBundle:Company')->find(1);
57 57
         // Create and save the PDF file to print
58 58
         $html = $this->renderView(
59
-            'AppBundle:' . $from . ':print.pdf.twig',
59
+            'AppBundle:'.$from.':print.pdf.twig',
60 60
             ['articles' => $orders->getArticles(), 'orders' => $orders, 'company' => $company, ]
61 61
         );
62 62
         return new Response(
63 63
             $this->get('knp_snappy.pdf')->getOutputFromHtml(
64 64
                 $html,
65
-                $this->getArray((string)date('d/m/y - H:i:s'), '')
65
+                $this->getArray((string) date('d/m/y - H:i:s'), '')
66 66
             ),
67 67
             200,
68 68
             array(
69 69
                 'Content-Type' => 'application/pdf',
70
-                'Content-Disposition' => 'attachment; filename="' . $file . '"'
70
+                'Content-Disposition' => 'attachment; filename="'.$file.'"'
71 71
             )
72 72
         );
73 73
     }
Please login to merge, or discard this patch.
src/AppBundle/Controller/OrdersController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         $em = $this->getDoctrine()->getManager();
46 46
         $item = $this->container->getParameter('knp_paginator.page_range');
47 47
         $qb = $em->getRepository('AppBundle:Orders')->createQueryBuilder('o');
48
-        $qb->where('o.orderdate < ' . date('Y-m-d'));
48
+        $qb->where('o.orderdate < '.date('Y-m-d'));
49 49
         
50 50
         $createForm = $this->createCreateForm('orders_create');
51 51
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
         $orders = new Orders();
115 115
         $form = $this->createForm(OrdersType::class, $orders);
116
-        $return = ['orders' => $orders, 'form' => $form->createView(),];
116
+        $return = ['orders' => $orders, 'form' => $form->createView(), ];
117 117
         $form->handleRequest($request);
118 118
         $supplier = $orders->getSupplier();
119 119
         $articles = $etm->getRepository('AppBundle:Article')->getArticleFromSupplier($supplier->getId());
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
             if ($date >= date('w')) {
230 230
                 $diffOrder = $date - date('w');
231 231
                 $diffDeliv = $diffOrder + $supplier->getDelaydeliv();
232
-                $dateOrder = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j')+$diffOrder, date('Y')));
233
-                $delivDate = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j')+$diffDeliv, date('Y')));
232
+                $dateOrder = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j') + $diffOrder, date('Y')));
233
+                $delivDate = date('Y-m-d H:i:s', mktime(0, 0, 0, date('n'), date('j') + $diffDeliv, date('Y')));
234 234
                 $orders->setOrderDate(\DateTime::createFromFormat('Y-m-d H:i:s', $dateOrder));
235 235
                 $orders->setDelivDate(\DateTime::createFromFormat('Y-m-d H:i:s', $delivDate));
236 236
                 break;
Please login to merge, or discard this patch.
src/AppBundle/Entity/Orders.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function setAmount($amount)
152 152
     {
153
-        $this->amount = (double)$amount;
153
+        $this->amount = (double) $amount;
154 154
 
155 155
         return $this;
156 156
     }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
      */
174 174
     public function setTva($tva)
175 175
     {
176
-        $this->tva = (double)$tva;
176
+        $this->tva = (double) $tva;
177 177
 
178 178
         return $this;
179 179
     }
Please login to merge, or discard this patch.
src/AppBundle/Controller/GroupController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
         $form = $this->createForm(GroupType::class, $group);
101 101
         AbstractController::addRolesAction($form, $group);
102 102
         $form->handleRequest($request);
103
-        $return = ['group' => $group, 'form' => $form->createView(),];
103
+        $return = ['group' => $group, 'form' => $form->createView(), ];
104 104
 
105 105
         if ($form->isValid()) {
106 106
             $etm = $this->getDoctrine()->getManager();
Please login to merge, or discard this patch.
src/AppBundle/Controller/AbstractController.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      * @param Object $entity     Entity
258 258
      * @param Request $request   Request in progress
259 259
      * @param string $entityName Name of Entity
260
-     * @return array
260
+     * @return \Symfony\Component\HttpFoundation\RedirectResponse
261 261
      */
262 262
     public function abstractDeleteWithArticlesAction($entity, Request $request, $entityName)
263 263
     {
@@ -278,6 +278,9 @@  discard block
 block discarded – undo
278 278
         return $this->redirect($this->generateUrl($entityName));
279 279
     }
280 280
 
281
+    /**
282
+     * @param string $entityName
283
+     */
281 284
     private function testReturnParam($entity, $entityName)
282 285
     {
283 286
         $entityArray = ['company', 'settings', 'group', 'tva'];
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             $this->addRolesAction($form, $entityNew);
154 154
         }
155 155
         $form->handleRequest($request);
156
-        $return = [$entity => $entityNew, 'form' => $form->createView(),];
156
+        $return = [$entity => $entityNew, 'form' => $form->createView(), ];
157 157
 
158 158
         if ($form->isValid()) {
159 159
             $etm = $this->getDoctrine()->getManager();
@@ -262,9 +262,9 @@  discard block
 block discarded – undo
262 262
     public function abstractDeleteWithArticlesAction($entity, Request $request, $entityName)
263 263
     {
264 264
         $etm = $this->getDoctrine()->getManager();
265
-        $form = $this->createDeleteForm($entity->getId(), $entityName . '_delete');
265
+        $form = $this->createDeleteForm($entity->getId(), $entityName.'_delete');
266 266
         $entityArticles = $etm
267
-            ->getRepository('AppBundle:' .  ucfirst($entityName) . 'Articles')
267
+            ->getRepository('AppBundle:'.ucfirst($entityName).'Articles')
268 268
             ->findBy([$entityName => $entity->getId()]);
269 269
 
270 270
         if ($form->handleRequest($request)->isValid()) {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     {
317 317
         $session = new Session();
318 318
 
319
-        return $session->has('sort.' . $name) ? $session->get('sort.' . $name) : null;
319
+        return $session->has('sort.'.$name) ? $session->get('sort.'.$name) : null;
320 320
     }
321 321
 
322 322
     /**
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             } else {
341 341
                 $alias = current($qbd->getDQLPart('from'))->getAlias();
342 342
             }
343
-            $qbd->orderBy($alias . '.' . $order['field'], $order['type']);
343
+            $qbd->orderBy($alias.'.'.$order['field'], $order['type']);
344 344
         }
345 345
     }
346 346
 
Please login to merge, or discard this patch.