Completed
Pull Request — master (#20)
by Christian
10:11
created
src/MWSMerchantFulfillment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
         $this->client = $client;
14 14
     }
15 15
 
16
-    public function getEligibleShippingServices($params = [])
16
+    public function getEligibleShippingServices($params = [ ])
17 17
     {
18 18
         $action = 'GetEligibleShippingServices';
19 19
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         return $data;
36 36
     }
37 37
 
38
-    public function createShipment($params = [])
38
+    public function createShipment($params = [ ])
39 39
     {
40 40
         $action = 'CreateShipment';
41 41
 
Please login to merge, or discard this patch.
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,
@@ -211,21 +211,21 @@  discard block
 block discarded – undo
211 211
 
212 212
     public function getMarketPlaceParams()
213 213
     {
214
-        $params = [];
214
+        $params = [ ];
215 215
         foreach ($this->marketPlaces as $index => $marketPlace) {
216 216
             $keyName = 'MarketplaceId.Id.'.($index + 1);
217
-            $params[$keyName] = $this->countries[$marketPlace];
217
+            $params[ $keyName ] = $this->countries[ $marketPlace ];
218 218
         }
219 219
 
220 220
         return $params;
221 221
     }
222 222
 
223
-    public function generateRequestUri($action, $version, $params = [])
223
+    public function generateRequestUri($action, $version, $params = [ ])
224 224
     {
225 225
         return http_build_query($this->getDefaultQueryParams($action, $version, $params), '', '&', PHP_QUERY_RFC3986);
226 226
     }
227 227
 
228
-    public function getQueryStringForSignature($path, $action, $version, $params = [])
228
+    public function getQueryStringForSignature($path, $action, $version, $params = [ ])
229 229
     {
230 230
         return  'POST'
231 231
                     ."\n"
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
                     .$this->generateRequestUri($action, $version, $params);
237 237
     }
238 238
 
239
-    public function generateSignature($path, $action, $version, $params = [])
239
+    public function generateSignature($path, $action, $version, $params = [ ])
240 240
     {
241 241
         $signature = base64_encode(
242 242
             hash_hmac(
@@ -250,10 +250,10 @@  discard block
 block discarded – undo
250 250
         return $signature;
251 251
     }
252 252
 
253
-    public function getQuery($path, $action, $version, $params = [])
253
+    public function getQuery($path, $action, $version, $params = [ ])
254 254
     {
255 255
         $queryParameters = $this->getDefaultQueryParams($action, $version, $params);
256
-        $queryParameters['Signature'] = $this->generateSignature($path, $action, $version, $params);
256
+        $queryParameters[ 'Signature' ] = $this->generateSignature($path, $action, $version, $params);
257 257
 
258 258
         return $queryParameters;
259 259
     }
Please login to merge, or discard this patch.