Completed
Push — master ( 913b24...1cabe7 )
by Christian
08:33 queued 11s
created
src/AmazonMWSServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 
16 16
     public function register()
17 17
     {
18
-        $this->app->bind('amazon-mws', function () {
18
+        $this->app->bind('amazon-mws', function() {
19 19
             return new MWSService();
20 20
         });
21 21
 
Please login to merge, or discard this patch.
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.
src/MWSOrders.php 1 patch
Spacing   +13 added lines, -13 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 list($params = [])
16
+    public function list($params = [ ])
17 17
     {
18 18
         $nextToken = data_get($params, 'NextToken');
19 19
         $action = 'ListOrders';
@@ -22,18 +22,18 @@  discard block
 block discarded – undo
22 22
             $action = 'ListOrdersByNextToken';
23 23
         }
24 24
 
25
-        $response = $this->client->post($action, '/Orders/' . self::VERSION, self::VERSION, $params);
26
-        return $this->parseResponse($response, $action. 'Result', 'Orders.Order');
25
+        $response = $this->client->post($action, '/Orders/'.self::VERSION, self::VERSION, $params);
26
+        return $this->parseResponse($response, $action.'Result', 'Orders.Order');
27 27
     }
28 28
 
29 29
     public function get($ids)
30 30
     {
31 31
         $ids = is_array($ids) ? $ids : func_get_args();
32
-        $params = [];
32
+        $params = [ ];
33 33
 
34 34
         foreach ($ids as $key => $id) {
35 35
             $keyName = 'AmazonOrderId.Id.'.($key + 1);
36
-            $params[$keyName] = $id;
36
+            $params[ $keyName ] = $id;
37 37
         }
38 38
 
39 39
         $response = $this->client->post('GetOrder', '/Orders/'.self::VERSION, self::VERSION, $params);
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
     protected function parseResponse($response, $resultTypeName, $dataName)
55 55
     {
56 56
         $requestId = data_get($response, 'ResponseMetadata.RequestId');
57
-        $data = data_get($response, $resultTypeName . '.' . $dataName);
58
-        $nextToken = data_get($response, $resultTypeName . '.NextToken');
59
-        $createdBefore = data_get($response, $resultTypeName . '.CreatedBefore');
57
+        $data = data_get($response, $resultTypeName.'.'.$dataName);
58
+        $nextToken = data_get($response, $resultTypeName.'.NextToken');
59
+        $createdBefore = data_get($response, $resultTypeName.'.CreatedBefore');
60 60
 
61 61
         //Check if single list item and wrap
62
-        if ((! data_get($data, '0')) && $resultTypeName == 'ListOrderItemsResult') {
63
-            $data = [$data];
62
+        if ((!data_get($data, '0')) && $resultTypeName == 'ListOrderItemsResult') {
63
+            $data = [ $data ];
64 64
         }
65 65
 
66 66
         $data = [
@@ -69,15 +69,15 @@  discard block
 block discarded – undo
69 69
         ];
70 70
 
71 71
         if ($nextToken) {
72
-            $data['next_token'] = $nextToken;
72
+            $data[ 'next_token' ] = $nextToken;
73 73
         }
74 74
 
75 75
         if ($createdBefore) {
76
-            $data['created_before'] = $createdBefore;
76
+            $data[ 'created_before' ] = $createdBefore;
77 77
         }
78 78
 
79 79
         if ($resultTypeName == 'ListOrderItemsResult') {
80
-            $data['order_id'] = data_get($response, $resultTypeName.'.AmazonOrderId');
80
+            $data[ 'order_id' ] = data_get($response, $resultTypeName.'.AmazonOrderId');
81 81
         }
82 82
 
83 83
         return $data;
Please login to merge, or discard this patch.