@@ -82,17 +82,17 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | - * Prepare API request headers |
|
| 86 | - * |
|
| 87 | - * Flatten headers from an associative array to a numerically indexed array |
|
| 88 | - * of `"Name: Value"` style entries like `CURLOPT_HTTPHEADER` expects. |
|
| 89 | - * Numerically indexed arrays are not modified. |
|
| 90 | - * |
|
| 91 | - * Extended by CanvasPest to include the API access token in the |
|
| 92 | - * `Authorization` header. |
|
| 93 | - * |
|
| 94 | - * @param string[] $headers |
|
| 95 | - * @return string[] |
|
| 85 | + * Prepare API request headers |
|
| 86 | + * |
|
| 87 | + * Flatten headers from an associative array to a numerically indexed array |
|
| 88 | + * of `"Name: Value"` style entries like `CURLOPT_HTTPHEADER` expects. |
|
| 89 | + * Numerically indexed arrays are not modified. |
|
| 90 | + * |
|
| 91 | + * Extended by CanvasPest to include the API access token in the |
|
| 92 | + * `Authorization` header. |
|
| 93 | + * |
|
| 94 | + * @param string[] $headers |
|
| 95 | + * @return string[] |
|
| 96 | 96 | **/ |
| 97 | 97 | protected function prepHeaders($headers) { |
| 98 | 98 | return parent::prepHeaders(array_merge($this->headers, $headers)); |
@@ -234,13 +234,13 @@ discard block |
||
| 234 | 234 | * @return CanvasObject|CanvasArray |
| 235 | 235 | **/ |
| 236 | 236 | public function delete($path, $data = array(), $headers = array()) { |
| 237 | - if (!empty($data)) { |
|
| 238 | - $pos = strpos($path, '?'); |
|
| 239 | - if ($pos !== false) { |
|
| 240 | - $path = substr($path, 0, $pos); |
|
| 241 | - } |
|
| 242 | - $path .= '?' . $this->http_build_query($data); |
|
| 243 | - } |
|
| 237 | + if (!empty($data)) { |
|
| 238 | + $pos = strpos($path, '?'); |
|
| 239 | + if ($pos !== false) { |
|
| 240 | + $path = substr($path, 0, $pos); |
|
| 241 | + } |
|
| 242 | + $path .= '?' . $this->http_build_query($data); |
|
| 243 | + } |
|
| 244 | 244 | return $this->postprocessResponse( |
| 245 | 245 | parent::delete($path, $headers) |
| 246 | 246 | ); |