@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if (is_int($pageNumber) && $pageNumber > 0 && $model instanceof CanvasPageLink && is_string($this->name) && !empty($this->name)) { |
88 | 88 | $this->endpoint = $model->endpoint; |
89 | 89 | $this->params = $model->params; |
90 | - switch($this->name) { |
|
90 | + switch ($this->name) { |
|
91 | 91 | case self::PREV: { |
92 | 92 | $this->params[self::PARAM_PAGE_NUMBER] = $pageNumber - 1; |
93 | 93 | break; |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $arr = array(); |
180 | 180 | $_key = $this->key; |
181 | 181 | $_page = $this->page; |
182 | - foreach($this as $obj) { |
|
182 | + foreach ($this as $obj) { |
|
183 | 183 | $arr[] = $obj->getArrayCopy(); |
184 | 184 | } |
185 | 185 | $this->page = $_page; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * |
118 | 118 | * @see http://php.net/manual/en/arrayaccess.offsetexists.php ArrayAccess::offsetExists() |
119 | 119 | **/ |
120 | - public function offsetExists ($offset) { |
|
120 | + public function offsetExists($offset) { |
|
121 | 121 | return isset($this->data[$offset]); |
122 | 122 | } |
123 | 123 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @see http://php.net/manual/en/arrayaccess.offsetexists.php ArrayAccess::offsetGet() |
132 | 132 | **/ |
133 | - public function offsetGet ($offset) { |
|
133 | + public function offsetGet($offset) { |
|
134 | 134 | return $this->data[$offset]; |
135 | 135 | } |
136 | 136 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * |
169 | 169 | * @see http://php.net/manual/en/arrayaccess.offsetunset.php ArrayAccess::offsetUnset() |
170 | 170 | **/ |
171 | - public function offsetUnset ($offset) { |
|
171 | + public function offsetUnset($offset) { |
|
172 | 172 | throw new CanvasObject_Exception( |
173 | 173 | 'Canvas objects are immutable', |
174 | 174 | CanvasObject_Exception::IMMUTABLE |
@@ -238,7 +238,7 @@ |
||
238 | 238 | public function getArrayCopy() { |
239 | 239 | $_key = $this->key; |
240 | 240 | $this->rewindToPageNumber(1); |
241 | - while(isset($this->pagination[CanvasPageLink::NEXT])) { |
|
241 | + while (isset($this->pagination[CanvasPageLink::NEXT])) { |
|
242 | 242 | $this->rewindToPageNumber($this->pagination[CanvasPageLink::NEXT]); |
243 | 243 | } |
244 | 244 | $this->key = $_key; |
@@ -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 | ); |