Completed
Push — master ( fb5f04...e69765 )
by Christian
06:22
created
src/MWSClient.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -147,6 +147,11 @@
 block discarded – undo
147 147
         return $this->marketplaceIds;
148 148
     }
149 149
 
150
+    /**
151
+     * @param string $action
152
+     * @param string $path
153
+     * @param string $version
154
+     */
150 155
     public function post($action, $path, $version, $params = [], $body = null)
151 156
     {
152 157
         $headers = [
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
         $this->accessKeyId = config('amazon-mws.access_key_id');
66 66
         $this->secretKey = config('amazon-mws.secret_key');
67 67
         $this->sellerId = config('amazon-mws.seller_id');
68
-        $this->marketPlaces = ['DE'];
69
-        $this->client = $client ?: new Client(['timeout'  => 60]);
68
+        $this->marketPlaces = [ 'DE' ];
69
+        $this->client = $client ?: new Client([ 'timeout'  => 60 ]);
70 70
     }
71 71
 
72 72
     public function setMarketPlaces($countryCodes)
@@ -116,11 +116,11 @@  discard block
 block discarded – undo
116 116
 
117 117
     public function getDomain()
118 118
     {
119
-        $mainMarketPlace = $this->marketPlaces[0];
119
+        $mainMarketPlace = $this->marketPlaces[ 0 ];
120 120
         if ($mainMarketPlace) {
121
-            $marketPlaceId = $this->countries[$mainMarketPlace];
121
+            $marketPlaceId = $this->countries[ $mainMarketPlace ];
122 122
 
123
-            return $this->marketplaceIds[$marketPlaceId];
123
+            return $this->marketplaceIds[ $marketPlaceId ];
124 124
         }
125 125
 
126 126
         throw new CountryIsMissingException();
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         return $this->marketplaceIds;
148 148
     }
149 149
 
150
-    public function post($action, $path, $version, $params = [], $body = null)
150
+    public function post($action, $path, $version, $params = [ ], $body = null)
151 151
     {
152 152
         $headers = [
153 153
             'Accept' => 'application/xml',
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         ];
156 156
 
157 157
         if ($action === 'SubmitFeed') {
158
-            $headers['Content-Type'] = 'text/xml; charset=iso-8859-1';
158
+            $headers[ 'Content-Type' ] = 'text/xml; charset=iso-8859-1';
159 159
         }
160 160
 
161 161
         $requestOptions = [
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         return json_decode($json, true);
173 173
     }
174 174
 
175
-    public function getDefaultQueryParams($action, $version, $params = [])
175
+    public function getDefaultQueryParams($action, $version, $params = [ ])
176 176
     {
177 177
         $queryParameters = [
178 178
             'Action' => $action,
@@ -192,21 +192,21 @@  discard block
 block discarded – undo
192 192
 
193 193
     public function getMarketPlaceParams()
194 194
     {
195
-        $params = [];
195
+        $params = [ ];
196 196
         foreach ($this->marketPlaces as $index => $marketPlace) {
197 197
             $keyName = 'MarketplaceId.Id.'.($index + 1);
198
-            $params[$keyName] = $this->countries[$marketPlace];
198
+            $params[ $keyName ] = $this->countries[ $marketPlace ];
199 199
         }
200 200
 
201 201
         return $params;
202 202
     }
203 203
 
204
-    public function generateRequestUri($action, $version, $params = [])
204
+    public function generateRequestUri($action, $version, $params = [ ])
205 205
     {
206 206
         return http_build_query($this->getDefaultQueryParams($action, $version, $params), null, '&', PHP_QUERY_RFC3986);
207 207
     }
208 208
 
209
-    public function getQueryStringForSignature($path, $action, $version, $params = [])
209
+    public function getQueryStringForSignature($path, $action, $version, $params = [ ])
210 210
     {
211 211
         return  'POST'
212 212
                     ."\n"
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                     .$this->generateRequestUri($action, $version, $params);
218 218
     }
219 219
 
220
-    public function generateSignature($path, $action, $version, $params = [])
220
+    public function generateSignature($path, $action, $version, $params = [ ])
221 221
     {
222 222
         $signature = base64_encode(
223 223
             hash_hmac(
@@ -231,10 +231,10 @@  discard block
 block discarded – undo
231 231
         return $signature;
232 232
     }
233 233
 
234
-    public function getQuery($path, $action, $version, $params = [])
234
+    public function getQuery($path, $action, $version, $params = [ ])
235 235
     {
236 236
         $queryParameters = $this->getDefaultQueryParams($action, $version, $params);
237
-        $queryParameters['Signature'] = $this->generateSignature($path, $action, $version, $params);
237
+        $queryParameters[ 'Signature' ] = $this->generateSignature($path, $action, $version, $params);
238 238
 
239 239
         return $queryParameters;
240 240
     }
Please login to merge, or discard this patch.