Completed
Push — master ( c7eb25...66e657 )
by Christian
14:25
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 = [])
151 156
     {
152 157
         $headers = [
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  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'];
68
+        $this->marketPlaces = [ 'DE' ];
69 69
         $this->client = $client ?: new Client();
70 70
     }
71 71
 
@@ -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 = [])
150
+    public function post($action, $path, $version, $params = [ ])
151 151
     {
152 152
         $headers = [
153 153
             'Accept' => 'application/xml',
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         return json_decode($json, true);
168 168
     }
169 169
 
170
-    public function getDefaultQueryParams($action, $version, $params = [])
170
+    public function getDefaultQueryParams($action, $version, $params = [ ])
171 171
     {
172 172
         $queryParameters = [
173 173
             'Action' => $action,
@@ -187,21 +187,21 @@  discard block
 block discarded – undo
187 187
 
188 188
     public function getMarketPlaceParams()
189 189
     {
190
-        $params = [];
190
+        $params = [ ];
191 191
         foreach ($this->marketPlaces as $index => $marketPlace) {
192 192
             $keyName = 'MarketplaceId.Id.'.($index + 1);
193
-            $params[$keyName] = $this->countries[$marketPlace];
193
+            $params[ $keyName ] = $this->countries[ $marketPlace ];
194 194
         }
195 195
 
196 196
         return $params;
197 197
     }
198 198
 
199
-    public function generateRequestUri($action, $version, $params = [])
199
+    public function generateRequestUri($action, $version, $params = [ ])
200 200
     {
201 201
         return http_build_query($this->getDefaultQueryParams($action, $version, $params), null, '&', PHP_QUERY_RFC3986);
202 202
     }
203 203
 
204
-    public function getQueryStringForSignature($path, $action, $version, $params = [])
204
+    public function getQueryStringForSignature($path, $action, $version, $params = [ ])
205 205
     {
206 206
         return  'POST'
207 207
                     ."\n"
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                     .$this->generateRequestUri($action, $version, $params);
213 213
     }
214 214
 
215
-    public function generateSignature($path, $action, $version, $params = [])
215
+    public function generateSignature($path, $action, $version, $params = [ ])
216 216
     {
217 217
         $signature = base64_encode(
218 218
             hash_hmac(
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
         return $signature;
227 227
     }
228 228
 
229
-    public function getQuery($path, $action, $version, $params = [])
229
+    public function getQuery($path, $action, $version, $params = [ ])
230 230
     {
231 231
         $queryParameters = $this->getDefaultQueryParams($action, $version, $params);
232
-        $queryParameters['Signature'] = $this->generateSignature($path, $action, $version, $params);
232
+        $queryParameters[ 'Signature' ] = $this->generateSignature($path, $action, $version, $params);
233 233
 
234 234
         return $queryParameters;
235 235
     }
Please login to merge, or discard this patch.
src/MWSOrders.php 1 patch
Spacing   +3 added lines, -3 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
         //TODO
19 19
     }
@@ -21,11 +21,11 @@  discard block
 block discarded – undo
21 21
     public function get($ids)
22 22
     {
23 23
         $ids = is_array($ids) ? $ids : func_get_args();
24
-        $params = [];
24
+        $params = [ ];
25 25
 
26 26
         foreach ($ids as $key => $id) {
27 27
             $keyName = 'AmazonOrderId.Id.'.($key + 1);
28
-            $params[$keyName] = $id;
28
+            $params[ $keyName ] = $id;
29 29
         }
30 30
 
31 31
         $response = $this->client->post('GetOrder', '/Orders/'.self::VERSION, self::VERSION, $params);
Please login to merge, or discard this patch.