@@ -74,15 +74,15 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function __construct(array $config = array()) |
76 | 76 | { |
77 | - if(isset($config['api_key'])) { |
|
77 | + if (isset($config['api_key'])) { |
|
78 | 78 | $this->api_key = $config['api_key']; |
79 | 79 | } |
80 | 80 | |
81 | - if(isset($config['api_secret'])) { |
|
81 | + if (isset($config['api_secret'])) { |
|
82 | 82 | $this->api_secret = $config['api_secret']; |
83 | 83 | } |
84 | 84 | |
85 | - if(isset($config['site_url'])) { |
|
85 | + if (isset($config['site_url'])) { |
|
86 | 86 | $this->site_url = $config['site_url']; |
87 | 87 | } |
88 | 88 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function getSiteUrl($endpoint = '', array $query = array()) |
149 | 149 | { |
150 | - if(count($query) != '0') { |
|
150 | + if (count($query) != '0') { |
|
151 | 151 | $endpoint .= '&'.http_build_query($query); |
152 | 152 | } |
153 | 153 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | //being sent versus what's expected to be sent. So we remove them and prepare for |
211 | 211 | //query usage |
212 | 212 | $query = array(); |
213 | - if(strtolower($method)== 'get') { |
|
213 | + if (strtolower($method) == 'get') { |
|
214 | 214 | $query = $payload; |
215 | 215 | $payload = array(); |
216 | 216 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $request = new Request($method, $endpoint, $payload); |
220 | 220 | $headers = $request->sign($token, 'm62_auth_'); |
221 | 221 | |
222 | - if(strtolower($method)== 'get') { |
|
222 | + if (strtolower($method) == 'get') { |
|
223 | 223 | $payload = array(); |
224 | 224 | } |
225 | 225 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | { |
252 | 252 | $ch = $this->getCurlHandle(); |
253 | 253 | $parsed_headers = array(); |
254 | - foreach($headers AS $key => $value) { |
|
254 | + foreach ($headers AS $key => $value) { |
|
255 | 255 | $parsed_headers[] = $key.': '.$value; |
256 | 256 | } |
257 | 257 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | $json_payload = json_encode($payload); |
271 | 271 | |
272 | 272 | $options[CURLOPT_POSTFIELDS] = $json_payload; |
273 | - $parsed_headers[] = 'Content-Length: ' . strlen($json_payload); |
|
273 | + $parsed_headers[] = 'Content-Length: '.strlen($json_payload); |
|
274 | 274 | $parsed_headers[] = 'Content-Type: application/json'; |
275 | 275 | $options[CURLOPT_HTTPHEADER] = $parsed_headers; |
276 | 276 | } |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $this->debug_info = curl_getinfo($ch); |
288 | 288 | |
289 | 289 | if ($response_raw === false) { |
290 | - throw new \RuntimeException('Request Error: ' . curl_error($ch)); |
|
290 | + throw new \RuntimeException('Request Error: '.curl_error($ch)); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |