Completed
Push — master ( a53568...dd693e )
by Christian
15:17 queued 05:16
created
src/MWSClient.php 1 patch
Spacing   +15 added lines, -15 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 = [
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
         return json_decode($json, true);
191 191
     }
192 192
 
193
-    public function getDefaultQueryParams($action, $version, $params = [])
193
+    public function getDefaultQueryParams($action, $version, $params = [ ])
194 194
     {
195 195
         $queryParameters = [
196 196
             'Action' => $action,
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
     public function getMarketPlaceParams($type = null)
214 214
     {
215
-        $params = [];
215
+        $params = [ ];
216 216
         foreach ($this->marketPlaces as $index => $marketPlace) {
217 217
             if ($type === '_UPLOAD_VAT_INVOICE_') {
218 218
                 $marketPlaceKeyName = 'MarketplaceIdList.Id.';
@@ -221,18 +221,18 @@  discard block
 block discarded – undo
221 221
             }
222 222
 
223 223
             $keyName = $marketPlaceKeyName.($index + 1);
224
-            $params[$keyName] = $this->countries[$marketPlace];
224
+            $params[ $keyName ] = $this->countries[ $marketPlace ];
225 225
         }
226 226
 
227 227
         return $params;
228 228
     }
229 229
 
230
-    public function generateRequestUri($action, $version, $params = [])
230
+    public function generateRequestUri($action, $version, $params = [ ])
231 231
     {
232 232
         return http_build_query($this->getDefaultQueryParams($action, $version, $params), '', '&', PHP_QUERY_RFC3986);
233 233
     }
234 234
 
235
-    public function getQueryStringForSignature($path, $action, $version, $params = [])
235
+    public function getQueryStringForSignature($path, $action, $version, $params = [ ])
236 236
     {
237 237
         return  'POST'
238 238
                     ."\n"
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                     .$this->generateRequestUri($action, $version, $params);
244 244
     }
245 245
 
246
-    public function generateSignature($path, $action, $version, $params = [])
246
+    public function generateSignature($path, $action, $version, $params = [ ])
247 247
     {
248 248
         $signature = base64_encode(
249 249
             hash_hmac(
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
         return $signature;
258 258
     }
259 259
 
260
-    public function getQuery($path, $action, $version, $params = [])
260
+    public function getQuery($path, $action, $version, $params = [ ])
261 261
     {
262 262
         $queryParameters = $this->getDefaultQueryParams($action, $version, $params);
263
-        $queryParameters['Signature'] = $this->generateSignature($path, $action, $version, $params);
263
+        $queryParameters[ 'Signature' ] = $this->generateSignature($path, $action, $version, $params);
264 264
 
265 265
         return $queryParameters;
266 266
     }
Please login to merge, or discard this patch.