Completed
Push — master ( e75e2a...a718c6 )
by Christian
17:51 queued 07:51
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   +8 added lines, -8 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';
@@ -30,11 +30,11 @@  discard block
 block discarded – undo
30 30
     public function get($ids)
31 31
     {
32 32
         $ids = is_array($ids) ? $ids : func_get_args();
33
-        $params = [];
33
+        $params = [ ];
34 34
 
35 35
         foreach ($ids as $key => $id) {
36 36
             $keyName = 'AmazonOrderId.Id.'.($key + 1);
37
-            $params[$keyName] = $id;
37
+            $params[ $keyName ] = $id;
38 38
         }
39 39
 
40 40
         $response = $this->client->post('GetOrder', '/Orders/'.self::VERSION, self::VERSION, $params);
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
         $nextToken = data_get($response, $resultTypeName.'.NextToken');
60 60
         $createdBefore = data_get($response, $resultTypeName.'.CreatedBefore');
61 61
         //Check if single list item and wrap
62
-        if ((! data_get($data, '0')) && in_array($resultTypeName, [
62
+        if ((!data_get($data, '0')) && in_array($resultTypeName, [
63 63
             'ListOrderItemsResult',
64 64
             'ListOrderItemsByNextTokenResult',
65 65
             'ListOrdersResult',
66 66
             'ListOrdersByNextTokenResult',
67 67
         ])) {
68
-            $data = [$data];
68
+            $data = [ $data ];
69 69
         }
70 70
 
71 71
         $data = [
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
         ];
75 75
 
76 76
         if ($nextToken) {
77
-            $data['next_token'] = $nextToken;
77
+            $data[ 'next_token' ] = $nextToken;
78 78
         }
79 79
 
80 80
         if ($createdBefore) {
81
-            $data['created_before'] = $createdBefore;
81
+            $data[ 'created_before' ] = $createdBefore;
82 82
         }
83 83
 
84 84
         if ($resultTypeName == 'ListOrderItemsResult') {
85
-            $data['order_id'] = data_get($response, $resultTypeName.'.AmazonOrderId');
85
+            $data[ 'order_id' ] = data_get($response, $resultTypeName.'.AmazonOrderId');
86 86
         }
87 87
 
88 88
         return $data;
Please login to merge, or discard this patch.