Passed
Push — master ( a37f1a...1efd36 )
by Luiz Kim
06:57 queued 04:42
created
src/Service/OrderProductService.php 1 patch
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,7 +58,9 @@  discard block
 block discarded – undo
58 58
     public function postPersist(OrderProduct $orderProduct)
59 59
     {
60 60
 
61
-        if (!self::$mainProduct) return;
61
+        if (!self::$mainProduct) {
62
+          return;
63
+        }
62 64
         self::$mainProduct = false;
63 65
 
64 66
         $json = json_decode($this->request->getContent(), true);
@@ -76,7 +78,9 @@  discard block
 block discarded – undo
76 78
     public function preRemove(OrderProduct $orderProduct)
77 79
     {
78 80
 
79
-        if (!self::$mainProduct) return;
81
+        if (!self::$mainProduct) {
82
+          return;
83
+        }
80 84
         self::$mainProduct = false;
81 85
         $order = $orderProduct->getOrder();
82 86
         $this->manager->persist($order->setPrice(0));
@@ -85,8 +89,9 @@  discard block
 block discarded – undo
85 89
             'parentProduct'  => $orderProduct->getProduct(),
86 90
         ]);
87 91
 
88
-        foreach ($parentProducts as $parentProduct)
89
-            $this->manager->remove($parentProduct);
92
+        foreach ($parentProducts as $parentProduct) {
93
+                    $this->manager->remove($parentProduct);
94
+        }
90 95
         $this->manager->flush();
91 96
 
92 97
         self::$calculateBefore[] = $order;
Please login to merge, or discard this patch.