@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | protected function appendToken(& $url) |
| 65 | 65 | { |
| 66 | 66 | if (isset($this->accessToken)) { |
| 67 | - $url .= '?access_token=' . $this->accessToken; |
|
| 67 | + $url .= '?access_token='.$this->accessToken; |
|
| 68 | 68 | } else { |
| 69 | - $url .= '?client_id=' . $this->appId; |
|
| 69 | + $url .= '?client_id='.$this->appId; |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $paramsUrl = ''; |
| 81 | 81 | foreach ($params as $key => $value) { |
| 82 | - $paramsUrl .= '&' . $key . '=' . $value; |
|
| 82 | + $paramsUrl .= '&'.$key.'='.$value; |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | return $paramsUrl; |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function listByTag($tag, $params = array()) |
| 115 | 115 | { |
| 116 | - $endpoint = '/tags/' . urlencode($tag) . '/media/recent'; |
|
| 117 | - $url = $this->url . $endpoint; |
|
| 116 | + $endpoint = '/tags/'.urlencode($tag).'/media/recent'; |
|
| 117 | + $url = $this->url.$endpoint; |
|
| 118 | 118 | |
| 119 | 119 | // Create url parameters string |
| 120 | 120 | $paramsUrl = $this->paramsFromArray($params); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $signature = $this->generateSig($endpoint, $params); |
| 131 | 131 | |
| 132 | 132 | // Get API response |
| 133 | - $response = $this->request->get($url . $paramsUrl . '&sig=' . $signature); |
|
| 133 | + $response = $this->request->get($url.$paramsUrl.'&sig='.$signature); |
|
| 134 | 134 | |
| 135 | 135 | // Return response decoded to associative array |
| 136 | 136 | return json_decode($response, true); |
@@ -144,13 +144,13 @@ discard block |
||
| 144 | 144 | */ |
| 145 | 145 | public function likeMedia($id, $access_token, $method = 'POST') |
| 146 | 146 | { |
| 147 | - $endpoint = '/media/' . $id . '/likes'; |
|
| 148 | - $url = $this->url . $endpoint; |
|
| 147 | + $endpoint = '/media/'.$id.'/likes'; |
|
| 148 | + $url = $this->url.$endpoint; |
|
| 149 | 149 | |
| 150 | 150 | $sigParams = array('access_token' => $access_token); |
| 151 | 151 | $signature = $this->generateSig($endpoint, $sigParams); |
| 152 | 152 | |
| 153 | - $url .= '?access_token=' . $access_token . '&sig=' . $signature; |
|
| 153 | + $url .= '?access_token='.$access_token.'&sig='.$signature; |
|
| 154 | 154 | |
| 155 | 155 | // Get API response |
| 156 | 156 | $response = $this->request->get($url, array(), $method); |
@@ -168,13 +168,13 @@ discard block |
||
| 168 | 168 | */ |
| 169 | 169 | public function getLikes($id, $access_token) |
| 170 | 170 | { |
| 171 | - $endpoint = '/media/' . $id . '/likes'; |
|
| 172 | - $url = $this->url . $endpoint; |
|
| 171 | + $endpoint = '/media/'.$id.'/likes'; |
|
| 172 | + $url = $this->url.$endpoint; |
|
| 173 | 173 | |
| 174 | 174 | $sigParams = array('access_token' => $access_token); |
| 175 | 175 | $signature = $this->generateSig($endpoint, $sigParams); |
| 176 | 176 | |
| 177 | - $url .= '?access_token=' . $access_token . '&sig=' . $signature; |
|
| 177 | + $url .= '?access_token='.$access_token.'&sig='.$signature; |
|
| 178 | 178 | |
| 179 | 179 | // Get API response |
| 180 | 180 | $response = $this->request->get($url); |
@@ -194,10 +194,10 @@ discard block |
||
| 194 | 194 | public function tag($tag, $access_token) |
| 195 | 195 | { |
| 196 | 196 | // Set url options |
| 197 | - $endpoint = '/tags/' . $tag; |
|
| 198 | - $url = $this->url . $endpoint; |
|
| 197 | + $endpoint = '/tags/'.$tag; |
|
| 198 | + $url = $this->url.$endpoint; |
|
| 199 | 199 | $signature = $this->generateSig($endpoint, array('access_token' => $access_token)); |
| 200 | - $url .= '?access_token=' . $access_token . '&sig=' . $signature; |
|
| 200 | + $url .= '?access_token='.$access_token.'&sig='.$signature; |
|
| 201 | 201 | |
| 202 | 202 | // Get API response |
| 203 | 203 | $response = $this->request->get($url); |
@@ -213,8 +213,8 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | public function mediaById($id) |
| 215 | 215 | { |
| 216 | - $endpoint = '/media/' . urlencode($id); |
|
| 217 | - $url = $this->url . $endpoint; |
|
| 216 | + $endpoint = '/media/'.urlencode($id); |
|
| 217 | + $url = $this->url.$endpoint; |
|
| 218 | 218 | |
| 219 | 219 | $sigParams = array(); |
| 220 | 220 | // Create url for query |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $this->appendToken($url); |
| 226 | 226 | $signature = $this->generateSig($endpoint, $sigParams); |
| 227 | 227 | |
| 228 | - $url .= '&sig=' . $signature; |
|
| 228 | + $url .= '&sig='.$signature; |
|
| 229 | 229 | |
| 230 | 230 | // Get API response |
| 231 | 231 | $response = $this->request->get($url); |
@@ -244,10 +244,10 @@ discard block |
||
| 244 | 244 | public function setUserRelationship($user_id, $access_token, $action = 'follow') |
| 245 | 245 | { |
| 246 | 246 | // Set url options |
| 247 | - $endpoint = '/users/' . $user_id . '/relationship'; |
|
| 248 | - $url = $this->url . $endpoint; |
|
| 247 | + $endpoint = '/users/'.$user_id.'/relationship'; |
|
| 248 | + $url = $this->url.$endpoint; |
|
| 249 | 249 | $signature = $this->generateSig($endpoint, array('access_token' => $access_token, 'action' => $action)); |
| 250 | - $url .= '?access_token=' . $access_token . '&sig=' . $signature; |
|
| 250 | + $url .= '?access_token='.$access_token.'&sig='.$signature; |
|
| 251 | 251 | |
| 252 | 252 | // Get API response |
| 253 | 253 | $response = $this->request->get($url, array('action' => $action), 'POST'); |
@@ -265,10 +265,10 @@ discard block |
||
| 265 | 265 | public function isFollowing($user_id, $access_token) |
| 266 | 266 | { |
| 267 | 267 | // Set url options |
| 268 | - $endpoint = '/users/' . $user_id . '/relationship'; |
|
| 269 | - $url = $this->url . $endpoint; |
|
| 268 | + $endpoint = '/users/'.$user_id.'/relationship'; |
|
| 269 | + $url = $this->url.$endpoint; |
|
| 270 | 270 | $signature = $this->generateSig($endpoint, array('access_token' => $access_token)); |
| 271 | - $url .= '?access_token=' . $access_token . '&sig=' . $signature; |
|
| 271 | + $url .= '?access_token='.$access_token.'&sig='.$signature; |
|
| 272 | 272 | |
| 273 | 273 | // Get API response |
| 274 | 274 | $response = $this->request->get($url); |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | */ |
| 290 | 290 | public function subscribeOnEvent($object, $aspect, $verify_token, $callback, $object_id = null) |
| 291 | 291 | { |
| 292 | - $url = $this->url . '/subscriptions'; |
|
| 292 | + $url = $this->url.'/subscriptions'; |
|
| 293 | 293 | $post = array( |
| 294 | 294 | 'client_id' => $this->appId, |
| 295 | 295 | 'client_secret' => $this->appSecret, |
@@ -315,7 +315,7 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | public function getSubscriptions() |
| 317 | 317 | { |
| 318 | - $url = $this->url . '/subscriptions?client_secret=' . $this->appSecret . '&client_id=' . $this->appId; |
|
| 318 | + $url = $this->url.'/subscriptions?client_secret='.$this->appSecret.'&client_id='.$this->appId; |
|
| 319 | 319 | |
| 320 | 320 | /// Get API response |
| 321 | 321 | $response = $this->request->get($url); |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | */ |
| 334 | 334 | public function deleteSubscription($id = '', $object = 'all', $object_id = null) |
| 335 | 335 | { |
| 336 | - $url = $this->url . '/subscriptions?client_secret=' . $this->appSecret . '&client_id=' . $this->appId; |
|
| 336 | + $url = $this->url.'/subscriptions?client_secret='.$this->appSecret.'&client_id='.$this->appId; |
|
| 337 | 337 | |
| 338 | 338 | // Try to find subscription id by media id |
| 339 | 339 | if (count($object_id)) { |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | // Delete all subscriptions for selected parameter |
| 344 | - $url .= !empty($id) ? ('&id=' . $id) : ('&object=' . $object); |
|
| 344 | + $url .= !empty($id) ? ('&id='.$id) : ('&object='.$object); |
|
| 345 | 345 | |
| 346 | 346 | // Get API response |
| 347 | 347 | $response = $this->request->get($url, array(), 'DELETE'); |
@@ -384,12 +384,12 @@ discard block |
||
| 384 | 384 | public function selfInfo($access_token) |
| 385 | 385 | { |
| 386 | 386 | $endpoint = '/users/self'; |
| 387 | - $url = $this->url . $endpoint; |
|
| 387 | + $url = $this->url.$endpoint; |
|
| 388 | 388 | |
| 389 | 389 | $sigParams = array('access_token' => $access_token); |
| 390 | 390 | $signature = $this->generateSig($endpoint, $sigParams); |
| 391 | 391 | |
| 392 | - $url .= '?access_token=' . $access_token . '&sig=' . $signature; |
|
| 392 | + $url .= '?access_token='.$access_token.'&sig='.$signature; |
|
| 393 | 393 | |
| 394 | 394 | // Get API response |
| 395 | 395 | $response = $this->request->get($url); |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | public function selfMedias($access_token, $params = array()) |
| 409 | 409 | { |
| 410 | 410 | $endpoint = '/users/self/media/recent'; |
| 411 | - $url = $this->url . $endpoint; |
|
| 411 | + $url = $this->url.$endpoint; |
|
| 412 | 412 | |
| 413 | 413 | // Create url parameters string |
| 414 | 414 | $paramsUrl = $this->paramsFromArray($params); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | $signature = $this->generateSig($endpoint, $params); |
| 417 | 417 | |
| 418 | 418 | // Get API response |
| 419 | - $response = $this->request->get($url . '?access_token=' . $access_token . $paramsUrl . '&sig=' . $signature); |
|
| 419 | + $response = $this->request->get($url.'?access_token='.$access_token.$paramsUrl.'&sig='.$signature); |
|
| 420 | 420 | |
| 421 | 421 | // Return response decoded to associative array |
| 422 | 422 | return json_decode($response, true); |