@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $e |
| 87 | 87 | ); |
| 88 | 88 | } |
| 89 | - return json_decode(self::$content); |
|
| 89 | + return json_decode(self::$content); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /* |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | protected static function getExceptionMessage(\stdClass $object) |
| 119 | 119 | { |
| 120 | 120 | $message = array(); |
| 121 | - $message['error_type'] = isset($object->meta) ? $object->meta->error_type : $object->error_type; |
|
| 122 | - $message['error_message'] = isset($object->meta) ? $object->meta->error_message : $object->error_message; |
|
| 123 | - $message['error_code'] = isset($object->meta) ? $object->meta->code : $object->code; |
|
| 121 | + $message['error_type'] = isset($object->meta) ? $object->meta->error_type : $object->error_type; |
|
| 122 | + $message['error_message'] = isset($object->meta) ? $object->meta->error_message : $object->error_message; |
|
| 123 | + $message['error_code'] = isset($object->meta) ? $object->meta->code : $object->code; |
|
| 124 | 124 | return $message; |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -20,8 +20,8 @@ |
||
| 20 | 20 | if (empty($oauth)) { |
| 21 | 21 | throw new InstagramOAuthException("Bad Request 400 empty Response", 400); |
| 22 | 22 | } |
| 23 | - $this->accessToken = $oauth->access_token; |
|
| 24 | - $this->user = isset($oauth->user) ? $oauth->user : null; |
|
| 23 | + $this->accessToken = $oauth->access_token; |
|
| 24 | + $this->user = isset($oauth->user) ? $oauth->user : null; |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /* |
@@ -58,10 +58,10 @@ discard block |
||
| 58 | 58 | if (!is_array($config)) { |
| 59 | 59 | throw new InstagramException('Invalid Instagram Configuration data', 400); |
| 60 | 60 | } |
| 61 | - $this->setClientId($config['ClientId']); |
|
| 62 | - $this->setClientSecret($config['ClientSecret']); |
|
| 63 | - $this->setCallbackUrl($config['Callback']); |
|
| 64 | - $this->state = isset($config['State']) ? $config['State'] : substr(md5(rand()), 0, 7); |
|
| 61 | + $this->setClientId($config['ClientId']); |
|
| 62 | + $this->setClientSecret($config['ClientSecret']); |
|
| 63 | + $this->setCallbackUrl($config['Callback']); |
|
| 64 | + $this->state = isset($config['State']) ? $config['State'] : substr(md5(rand()), 0, 7); |
|
| 65 | 65 | $this->client = HelperFactory::client(Constants::API_HOST); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -76,9 +76,9 @@ discard block |
||
| 76 | 76 | throw new InstagramException("Missing or Invalid Scope permission used", 400); |
| 77 | 77 | } |
| 78 | 78 | if (count(array_diff($parameters['scope'], $this->defaultScopes)) !== 0) { |
| 79 | - throw new InstagramException("Missing or Invalid Scope permission used", 400); |
|
| 79 | + throw new InstagramException("Missing or Invalid Scope permission used", 400); |
|
| 80 | 80 | } |
| 81 | - $this->scopes = $parameters['scope']; |
|
| 81 | + $this->scopes = $parameters['scope']; |
|
| 82 | 82 | $query = 'client_id='.$this->getClientId().'&redirect_uri='.urlencode($this->getCallbackUrl()).'&response_type=code&state='.$this->state; |
| 83 | 83 | $query .= isset($this->scopes) ? '&scope='.urlencode(str_replace(",", " ", implode(",", $parameters['scope']))) : ''; |
| 84 | 84 | return sprintf('%s%s?%s', Constants::API_HOST, Constants::API_AUTH, $query); |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | if ($this->oauthResponse instanceof InstagramOAuth) { |
| 173 | 173 | return $this->oauthResponse; |
| 174 | 174 | } |
| 175 | - $this->oauthResponse = new InstagramOAuth(json_decode(json_encode(["access_token" => null]))); |
|
| 176 | - return $this->oauthResponse; |
|
| 175 | + $this->oauthResponse = new InstagramOAuth(json_decode(json_encode(["access_token" => null]))); |
|
| 176 | + return $this->oauthResponse; |
|
| 177 | 177 | } |
| 178 | 178 | /* |
| 179 | 179 | * @return Client |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | if (!$response instanceof Response) { |
| 43 | 43 | throw new InstagramResponseException('Bad Request: Response is not valid instance of GuzzleHttp\Psr7\Response', 404); |
| 44 | 44 | } |
| 45 | - $this->setParams($response); |
|
| 45 | + $this->setParams($response); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /* |