@@ -15,7 +15,7 @@ |
||
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 |
@@ -147,6 +147,11 @@ |
||
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 = [ |
@@ -71,7 +71,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 = [ |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | |
188 | 188 | $xmlResponse = simplexml_load_string($response->getBody()->getContents(), 'SimpleXMLElement', LIBXML_NOWARNING | LIBXML_NOERROR); |
189 | 189 | |
190 | - if (! $xmlResponse) { |
|
190 | + if (!$xmlResponse) { |
|
191 | 191 | return (string) $response->getBody(); |
192 | 192 | } |
193 | 193 | |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | return json_decode($json, true); |
197 | 197 | } |
198 | 198 | |
199 | - public function getDefaultQueryParams($action, $version, $params = []) |
|
199 | + public function getDefaultQueryParams($action, $version, $params = [ ]) |
|
200 | 200 | { |
201 | 201 | $queryParameters = [ |
202 | 202 | 'Action' => $action, |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | public function getMarketPlaceParams($type = null) |
220 | 220 | { |
221 | - $params = []; |
|
221 | + $params = [ ]; |
|
222 | 222 | foreach ($this->marketPlaces as $index => $marketPlace) { |
223 | 223 | if ($type === '_UPLOAD_VAT_INVOICE_') { |
224 | 224 | $marketPlaceKeyName = 'MarketplaceIdList.Id.'; |
@@ -227,18 +227,18 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | $keyName = $marketPlaceKeyName.($index + 1); |
230 | - $params[$keyName] = $this->countries[$marketPlace]; |
|
230 | + $params[ $keyName ] = $this->countries[ $marketPlace ]; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | return $params; |
234 | 234 | } |
235 | 235 | |
236 | - public function generateRequestUri($action, $version, $params = []) |
|
236 | + public function generateRequestUri($action, $version, $params = [ ]) |
|
237 | 237 | { |
238 | 238 | return http_build_query($this->getDefaultQueryParams($action, $version, $params), '', '&', PHP_QUERY_RFC3986); |
239 | 239 | } |
240 | 240 | |
241 | - public function getQueryStringForSignature($path, $action, $version, $params = []) |
|
241 | + public function getQueryStringForSignature($path, $action, $version, $params = [ ]) |
|
242 | 242 | { |
243 | 243 | return 'POST' |
244 | 244 | ."\n" |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | .$this->generateRequestUri($action, $version, $params); |
250 | 250 | } |
251 | 251 | |
252 | - public function generateSignature($path, $action, $version, $params = []) |
|
252 | + public function generateSignature($path, $action, $version, $params = [ ]) |
|
253 | 253 | { |
254 | 254 | $signature = base64_encode( |
255 | 255 | hash_hmac( |
@@ -263,10 +263,10 @@ discard block |
||
263 | 263 | return $signature; |
264 | 264 | } |
265 | 265 | |
266 | - public function getQuery($path, $action, $version, $params = []) |
|
266 | + public function getQuery($path, $action, $version, $params = [ ]) |
|
267 | 267 | { |
268 | 268 | $queryParameters = $this->getDefaultQueryParams($action, $version, $params); |
269 | - $queryParameters['Signature'] = $this->generateSignature($path, $action, $version, $params); |
|
269 | + $queryParameters[ 'Signature' ] = $this->generateSignature($path, $action, $version, $params); |
|
270 | 270 | |
271 | 271 | return $queryParameters; |
272 | 272 | } |
@@ -13,7 +13,7 @@ discard block |
||
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 |
||
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); |
@@ -60,14 +60,14 @@ discard block |
||
60 | 60 | $createdBefore = data_get($response, $resultTypeName.'.CreatedBefore'); |
61 | 61 | |
62 | 62 | //Check if single list item and wrap |
63 | - if (! is_null($data) && (! data_get($data, '0')) && in_array($resultTypeName, [ |
|
63 | + if (!is_null($data) && (!data_get($data, '0')) && in_array($resultTypeName, [ |
|
64 | 64 | 'ListOrderItemsResult', |
65 | 65 | 'ListOrderItemsByNextTokenResult', |
66 | 66 | 'ListOrdersResult', |
67 | 67 | 'ListOrdersByNextTokenResult', |
68 | 68 | ])) { |
69 | 69 | |
70 | - $data = [$data]; |
|
70 | + $data = [ $data ]; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | $data = [ |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | ]; |
77 | 77 | |
78 | 78 | if ($nextToken) { |
79 | - $data['next_token'] = $nextToken; |
|
79 | + $data[ 'next_token' ] = $nextToken; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | if ($createdBefore) { |
83 | - $data['created_before'] = $createdBefore; |
|
83 | + $data[ 'created_before' ] = $createdBefore; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | if ($resultTypeName == 'ListOrderItemsResult') { |
87 | - $data['order_id'] = data_get($response, $resultTypeName.'.AmazonOrderId'); |
|
87 | + $data[ 'order_id' ] = data_get($response, $resultTypeName.'.AmazonOrderId'); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $data; |
@@ -13,7 +13,7 @@ discard block |
||
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 |
||
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 |
@@ -9,7 +9,7 @@ |
||
9 | 9 | protected $client; |
10 | 10 | protected $content; |
11 | 11 | protected $type; |
12 | - protected $params = []; |
|
12 | + protected $params = [ ]; |
|
13 | 13 | |
14 | 14 | public function __construct(MWSClient $client) |
15 | 15 | { |