@@ -170,7 +170,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -208,13 +208,13 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | case 'get': |
| 210 | 210 | $query = http_build_query($args, '', '&'); |
| 211 | - curl_setopt($ch, CURLOPT_URL, $url . '?' . $query); |
|
| 211 | + curl_setopt($ch, CURLOPT_URL, $url.'?'.$query); |
|
| 212 | 212 | break; |
| 213 | 213 | |
| 214 | 214 | case 'delete': |
| 215 | 215 | if ($args['EmailAddress']) { |
| 216 | 216 | $query = http_build_query(['email' => $args['EmailAddress']], '', '&'); |
| 217 | - curl_setopt($ch, CURLOPT_URL, $url . '?' . $query); |
|
| 217 | + curl_setopt($ch, CURLOPT_URL, $url.'?'.$query); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | case 'put': |
| 229 | 229 | if ($args['EmailAddress']) { |
| 230 | 230 | $query = http_build_query(['email' => $args['EmailAddress']], '', '&'); |
| 231 | - curl_setopt($ch, CURLOPT_URL, $url . '?' . $query); |
|
| 231 | + curl_setopt($ch, CURLOPT_URL, $url.'?'.$query); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | |
| 246 | 246 | $isSuccess = $this->determineSuccess($response, $formattedResponse, $timeout); |
| 247 | 247 | |
| 248 | - return is_array($formattedResponse) || ! is_bool($formattedResponse) ? $formattedResponse : $isSuccess; |
|
| 248 | + return is_array($formattedResponse) || !is_bool($formattedResponse) ? $formattedResponse : $isSuccess; |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | private function prepareStateForRequest($http_verb, $method, $url, $timeout) |
@@ -406,11 +406,11 @@ discard block |
||
| 406 | 406 | private function findHTTPStatus($response, $formattedResponse) |
| 407 | 407 | { |
| 408 | 408 | if (!empty($response['headers']) && isset($response['headers']['http_code'])) { |
| 409 | - return (int)$response['headers']['http_code']; |
|
| 409 | + return (int) $response['headers']['http_code']; |
|
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | if (!empty($response['body']) && isset($formattedResponse['status'])) { |
| 413 | - return (int)$formattedResponse['status']; |
|
| 413 | + return (int) $formattedResponse['status']; |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | return 418; |