Completed
Push — master ( ee470b...2c2371 )
by Clive
03:18
created
src/CampaignMonitor.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
     {
171 171
         $method = $this->formatMethod($method);
172 172
 
173
-        $url = $this->api_endpoint . $method . '.' . $this->format;
173
+        $url = $this->api_endpoint.$method.'.'.$this->format;
174 174
 
175 175
         $response = $this->prepareStateForRequest($http_verb, $method, $url, $timeout);
176 176
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         ];
181 181
 
182 182
         if (isset($args["language"])) {
183
-            $httpHeader[] = "Accept-Language: " . $args["language"];
183
+            $httpHeader[] = "Accept-Language: ".$args["language"];
184 184
         }
185 185
 
186 186
         $ch = curl_init();
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         curl_setopt($ch, CURLOPT_USERAGENT,
190 190
             'CliveWalkden/CampaignMonitor-API/3.1 (github.com/clivewalkden/campaign-monitor-api)');
191 191
         curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
192
-        curl_setopt($ch, CURLOPT_USERPWD, $this->api_key . ':nopass');
192
+        curl_setopt($ch, CURLOPT_USERPWD, $this->api_key.':nopass');
193 193
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
194 194
         curl_setopt($ch, CURLOPT_VERBOSE, true);
195 195
         curl_setopt($ch, CURLOPT_HEADER, true);
@@ -207,13 +207,13 @@  discard block
 block discarded – undo
207 207
 
208 208
             case 'get':
209 209
                 $query = http_build_query($args, '', '&');
210
-                curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
210
+                curl_setopt($ch, CURLOPT_URL, $url.'?'.$query);
211 211
                 break;
212 212
 
213 213
             case 'delete':
214 214
                 if ($args['EmailAddress']) {
215 215
                     $query = http_build_query(['email' => $args['EmailAddress']], '', '&');
216
-                    curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
216
+                    curl_setopt($ch, CURLOPT_URL, $url.'?'.$query);
217 217
                 }
218 218
 
219 219
                 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             case 'put':
228 228
                 if ($args['EmailAddress']) {
229 229
                     $query = http_build_query(['email' => $args['EmailAddress']], '', '&');
230
-                    curl_setopt($ch, CURLOPT_URL, $url . '?' . $query);
230
+                    curl_setopt($ch, CURLOPT_URL, $url.'?'.$query);
231 231
                 }
232 232
 
233 233
 //                echo '<pre>'.print_r($args, true).'</pre>';
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
         $isSuccess = $this->determineSuccess($response, $formattedResponse, $timeout);
259 259
 
260
-        return is_array($formattedResponse) || ! is_bool($formattedResponse) ? $formattedResponse : $isSuccess;
260
+        return is_array($formattedResponse) || !is_bool($formattedResponse) ? $formattedResponse : $isSuccess;
261 261
     }
262 262
 
263 263
     private function prepareStateForRequest($http_verb, $method, $url, $timeout)
@@ -427,11 +427,11 @@  discard block
 block discarded – undo
427 427
     private function findHTTPStatus($response, $formattedResponse)
428 428
     {
429 429
         if (!empty($response['headers']) && isset($response['headers']['http_code'])) {
430
-            return (int)$response['headers']['http_code'];
430
+            return (int) $response['headers']['http_code'];
431 431
         }
432 432
 
433 433
         if (!empty($response['body']) && isset($formattedResponse['status'])) {
434
-            return (int)$formattedResponse['status'];
434
+            return (int) $formattedResponse['status'];
435 435
         }
436 436
 
437 437
         return 418;
Please login to merge, or discard this patch.