Completed
Push — master ( 486f5f...cbd9d0 )
by Christian
16:06 queued 06:01
created
src/MWSClient.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $this->sellerId = config('amazon-mws.seller_id');
72 72
         $this->mwsAuthToken = config('amazon-mws.mws_auth_token') ?: null;
73 73
         $this->marketPlaces = explode(',', config('amazon-mws.default_market_place') ?: 'DE');
74
-        $this->client = $client ?: new Client(['timeout'  => 60]);
74
+        $this->client = $client ?: new Client([ 'timeout'  => 60 ]);
75 75
     }
76 76
 
77 77
     public function setMarketPlaces($countryCodes)
@@ -131,11 +131,11 @@  discard block
 block discarded – undo
131 131
 
132 132
     public function getDomain()
133 133
     {
134
-        $mainMarketPlace = $this->marketPlaces[0];
134
+        $mainMarketPlace = $this->marketPlaces[ 0 ];
135 135
         if ($mainMarketPlace) {
136
-            $marketPlaceId = $this->countries[$mainMarketPlace];
136
+            $marketPlaceId = $this->countries[ $mainMarketPlace ];
137 137
 
138
-            return $this->marketplaceIds[$marketPlaceId];
138
+            return $this->marketplaceIds[ $marketPlaceId ];
139 139
         }
140 140
 
141 141
         throw new CountryIsMissingException();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         return $this->marketplaceIds;
163 163
     }
164 164
 
165
-    public function post($action, $path, $version, $params = [], $body = null)
165
+    public function post($action, $path, $version, $params = [ ], $body = null)
166 166
     {
167 167
         $headers = [
168 168
             'Accept' => 'application/xml',
@@ -170,11 +170,11 @@  discard block
 block discarded – undo
170 170
         ];
171 171
 
172 172
         if ($action === 'SubmitFeed') {
173
-            $headers['Content-Type'] = 'text/xml; charset=iso-8859-1';
173
+            $headers[ 'Content-Type' ] = 'text/xml; charset=iso-8859-1';
174 174
         }
175 175
 
176 176
         if ($action === 'GetFeedSubmissionResult') {
177
-            $headers['Content-Type'] = 'x-www-form-urlencoded';
177
+            $headers[ 'Content-Type' ] = 'x-www-form-urlencoded';
178 178
         }
179 179
 
180 180
         $requestOptions = [
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
         $xmlResponse = simplexml_load_string($response->getBody()->getContents(), 'SimpleXMLElement', LIBXML_NOWARNING | LIBXML_NOERROR);
189 189
 
190
-        if (! $xmlResponse) {
190
+        if (!$xmlResponse) {
191 191
             return (string) $response->getBody();
192 192
         }
193 193
 
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         return json_decode($json, true);
197 197
     }
198 198
 
199
-    public function getDefaultQueryParams($action, $version, $params = [])
199
+    public function getDefaultQueryParams($action, $version, $params = [ ])
200 200
     {
201 201
         $queryParameters = [
202 202
             'Action' => $action,
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
     public function getMarketPlaceParams($type = null)
220 220
     {
221
-        $params = [];
221
+        $params = [ ];
222 222
         foreach ($this->marketPlaces as $index => $marketPlace) {
223 223
             if ($type === '_UPLOAD_VAT_INVOICE_') {
224 224
                 $marketPlaceKeyName = 'MarketplaceIdList.Id.';
@@ -227,18 +227,18 @@  discard block
 block discarded – undo
227 227
             }
228 228
 
229 229
             $keyName = $marketPlaceKeyName.($index + 1);
230
-            $params[$keyName] = $this->countries[$marketPlace];
230
+            $params[ $keyName ] = $this->countries[ $marketPlace ];
231 231
         }
232 232
 
233 233
         return $params;
234 234
     }
235 235
 
236
-    public function generateRequestUri($action, $version, $params = [])
236
+    public function generateRequestUri($action, $version, $params = [ ])
237 237
     {
238 238
         return http_build_query($this->getDefaultQueryParams($action, $version, $params), '', '&', PHP_QUERY_RFC3986);
239 239
     }
240 240
 
241
-    public function getQueryStringForSignature($path, $action, $version, $params = [])
241
+    public function getQueryStringForSignature($path, $action, $version, $params = [ ])
242 242
     {
243 243
         return  'POST'
244 244
                     ."\n"
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                     .$this->generateRequestUri($action, $version, $params);
250 250
     }
251 251
 
252
-    public function generateSignature($path, $action, $version, $params = [])
252
+    public function generateSignature($path, $action, $version, $params = [ ])
253 253
     {
254 254
         $signature = base64_encode(
255 255
             hash_hmac(
@@ -263,10 +263,10 @@  discard block
 block discarded – undo
263 263
         return $signature;
264 264
     }
265 265
 
266
-    public function getQuery($path, $action, $version, $params = [])
266
+    public function getQuery($path, $action, $version, $params = [ ])
267 267
     {
268 268
         $queryParameters = $this->getDefaultQueryParams($action, $version, $params);
269
-        $queryParameters['Signature'] = $this->generateSignature($path, $action, $version, $params);
269
+        $queryParameters[ 'Signature' ] = $this->generateSignature($path, $action, $version, $params);
270 270
 
271 271
         return $queryParameters;
272 272
     }
Please login to merge, or discard this patch.