Test Failed
Push — master ( d9d4f1...04fcd4 )
by Evgenii
06:20
created
src/OrderStatusDispatcher.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@
 block discarded – undo
56 56
 
57 57
         foreach ($this->xml->order->items->item as $item) {
58 58
             $orderItem = new Item();
59
-            $orderItem->setBarcode((string)$item['barcode'])
60
-                ->setQuantity((int)$item['quantity'])
59
+            $orderItem->setBarcode((string) $item['barcode'])
60
+                ->setQuantity((int) $item['quantity'])
61 61
                 ->setReturn(boolval($item['returns']))
62
-                ->setRetprice((float)$item['retprice']);
62
+                ->setRetprice((float) $item['retprice']);
63 63
             $this->items[] = $orderItem;
64 64
         }
65 65
     }
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,8 +43,9 @@  discard block
 block discarded – undo
43 43
     public function __construct(string $xmlBody)
44 44
     {
45 45
         $this->xml = simplexml_load_string($xmlBody);
46
-        if ($this->xml === false)
47
-            throw new Exception('XML body is not valid.');
46
+        if ($this->xml === false) {
47
+                    throw new Exception('XML body is not valid.');
48
+        }
48 49
 
49 50
         foreach ($this->xml->order->statushistory->status as $statusItem) {
50 51
             $this->statuses[] = new DalliOrderStatusEvent(
@@ -70,8 +71,9 @@  discard block
 block discarded – undo
70 71
      */
71 72
     public function isItemReturned($barcode): ?bool
72 73
     {
73
-        if (isset($this->items[$barcode]))
74
-            return $this->items[$barcode]->isReturned();
74
+        if (isset($this->items[$barcode])) {
75
+                    return $this->items[$barcode]->isReturned();
76
+        }
75 77
         return null;
76 78
     }
77 79
 
@@ -85,8 +87,9 @@  discard block
 block discarded – undo
85 87
 
86 88
     public function getStatusName(): ?string
87 89
     {
88
-        if ($this->getStatusId())
89
-            DalliOrderStatus::getLabel($this->getStatusId());
90
+        if ($this->getStatusId()) {
91
+                    DalliOrderStatus::getLabel($this->getStatusId());
92
+        }
90 93
         return null;
91 94
     }
92 95
 
@@ -110,8 +113,9 @@  discard block
 block discarded – undo
110 113
     {
111 114
         $returned = [];
112 115
         foreach ($this->items as $item) {
113
-            if ($item->isReturned())
114
-                $returned[] = $item;
116
+            if ($item->isReturned()) {
117
+                            $returned[] = $item;
118
+            }
115 119
         }
116 120
         return $returned;
117 121
     }
Please login to merge, or discard this patch.