@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function delete($endpoint, array $parameters = array()) |
| 110 | 110 | { |
| 111 | - return $this->execute("DELETE", sprintf("%s%s", $this->host, $endpoint) . "/", $parameters); |
|
| 111 | + return $this->execute("DELETE", sprintf("%s%s", $this->host, $endpoint)."/", $parameters); |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | // Check if the access token needs to be added |
| 157 | 157 | if ($this->access_token != null) { |
| 158 | 158 | $headers = array_merge($headers, array( |
| 159 | - "Authorization: Bearer " . $this->access_token, |
|
| 159 | + "Authorization: Bearer ".$this->access_token, |
|
| 160 | 160 | //"Content-type: application/x-www-form-urlencoded; charset=UTF-8", |
| 161 | 161 | "Content-Type:multipart/form-data" |
| 162 | 162 | )); |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | if ($response_data === false && !$ch->hasErrors()) { |
| 216 | 216 | throw new CurlException("Error: Curl request failed") |
| 217 | 217 | } |
| 218 | - else if($ch->hasErrors()) { |
|
| 219 | - throw new PinterestException('Error: execute() - cURL error: ' . $ch->getErrors(), $ch->getErrorNumber()); |
|
| 218 | + else if ($ch->hasErrors()) { |
|
| 219 | + throw new PinterestException('Error: execute() - cURL error: '.$ch->getErrors(), $ch->getErrorNumber()); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | // Initiate the response |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | |
| 225 | 225 | // Check the response code |
| 226 | 226 | if ($response->getResponseCode() >= 400) { |
| 227 | - throw new PinterestException('Pinterest error (code: ' . $response->getResponseCode() . ') with message: ' . $response->getMessage(), $response->getResponseCode()); |
|
| 227 | + throw new PinterestException('Pinterest error (code: '.$response->getResponseCode().') with message: '.$response->getMessage(), $response->getResponseCode()); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | // Get headers from last request |
@@ -188,8 +188,7 @@ discard block |
||
| 188 | 188 | |
| 189 | 189 | if (!class_exists("\CURLFile") && defined('CURLOPT_SAFE_UPLOAD')) { |
| 190 | 190 | $ch->setOption(CURLOPT_SAFE_UPLOAD, false); |
| 191 | - } |
|
| 192 | - elseif (class_exists("\CURLFile") && defined('CURLOPT_SAFE_UPLOAD')) { |
|
| 191 | + } elseif (class_exists("\CURLFile") && defined('CURLOPT_SAFE_UPLOAD')) { |
|
| 193 | 192 | $ch->setOption(CURLOPT_SAFE_UPLOAD, true); |
| 194 | 193 | } |
| 195 | 194 | |
@@ -214,8 +213,7 @@ discard block |
||
| 214 | 213 | |
| 215 | 214 | if ($response_data === false && !$ch->hasErrors()) { |
| 216 | 215 | throw new CurlException("Error: Curl request failed") |
| 217 | - } |
|
| 218 | - else if($ch->hasErrors()) { |
|
| 216 | + } else if($ch->hasErrors()) { |
|
| 219 | 217 | throw new PinterestException('Error: execute() - cURL error: ' . $ch->getErrors(), $ch->getErrorNumber()); |
| 220 | 218 | } |
| 221 | 219 | |