Test Failed
Branch main (2f747c)
by Josh
02:21
created
src/Client.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     public function authentication(): AuthResponse
65 65
     {
66 66
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/auth', [
67
-            'auth' => [$this->user_id, $this->api_key]
67
+            'auth' => [ $this->user_id, $this->api_key ]
68 68
         ]);
69 69
 
70 70
         return new AuthResponse(json_decode($response->getBody(), true));
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if (
76 76
             !in_array(
77 77
                 $currency_code,
78
-                ['AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'USD']
78
+                [ 'AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HUF', 'NOK', 'NZD', 'PLN', 'SEK', 'USD' ]
79 79
             )
80 80
         ) {
81 81
             // Murder a kitten...
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/balance/' . $currency_code, [
86
-            'auth' => [$this->user_id, $this->api_key]
86
+            'auth' => [ $this->user_id, $this->api_key ]
87 87
         ]);
88 88
 
89 89
         return new Balance(json_decode($response->getBody(), true));
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
     public function listAllProducts(): Generator
101 101
     {
102 102
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/products', [
103
-            'auth' => [$this->user_id, $this->api_key]
103
+            'auth' => [ $this->user_id, $this->api_key ]
104 104
         ]);
105 105
 
106 106
         $json = json_decode($response->getBody(), true);
107
-        foreach ($json['products'] as $product) {
107
+        foreach ($json[ 'products' ] as $product) {
108 108
             yield new Product($product);
109 109
         }
110 110
     }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     public function findAProduct($product_code): Product
113 113
     {
114 114
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/products/' . $product_code, [
115
-            'auth' => [$this->user_id, $this->api_key]
115
+            'auth' => [ $this->user_id, $this->api_key ]
116 116
         ]);
117 117
 
118 118
         return new Product(json_decode($response->getBody(), true));
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             'headers' => [
125 125
                 'content-type' => 'application/json',
126 126
             ],
127
-            'auth' => [$this->user_id, $this->api_key],
127
+            'auth' => [ $this->user_id, $this->api_key ],
128 128
             'body' => json_encode($order_request)
129 129
         ]);
130 130
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     public function findOrderDetails($order_id)
135 135
     {
136 136
         $response = $this->getHttpClient()->get($this->getEndpoint() . '/order-details/' . $order_id, [
137
-            'auth' => [$this->user_id, $this->api_key]
137
+            'auth' => [ $this->user_id, $this->api_key ]
138 138
         ]);
139 139
 
140 140
         return new OrderDetails(json_decode($response->getBody(), true));
Please login to merge, or discard this patch.