| @@ -101,10 +101,10 @@ | ||
| 101 | 101 | "code" => $code, | 
| 102 | 102 | "state" => $this->state | 
| 103 | 103 | ); | 
| 104 | - $response = HelperFactory::request($this->client, Constants::API_TOKEN, $options, 'POST'); | |
| 105 | - $this->oauthResponse = new InstagramOAuth( | |
| 106 | - json_decode($response->getBody()->getContents()) | |
| 107 | - ); | |
| 104 | + $response = HelperFactory::request($this->client, Constants::API_TOKEN, $options, 'POST'); | |
| 105 | + $this->oauthResponse = new InstagramOAuth( | |
| 106 | + json_decode($response->getBody()->getContents()) | |
| 107 | + ); | |
| 108 | 108 | return $this->oauthResponse; | 
| 109 | 109 | } | 
| 110 | 110 | |
| @@ -15,25 +15,25 @@ discard block | ||
| 15 | 15 | /** @var array $headers */ | 
| 16 | 16 | private $headers = []; | 
| 17 | 17 | |
| 18 | - /** @var bool */ | |
| 19 | - private $isPagination = false; | |
| 18 | + /** @var bool */ | |
| 19 | + private $isPagination = false; | |
| 20 | 20 | |
| 21 | - /** @var object */ | |
| 22 | - private $pagination; | |
| 21 | + /** @var object */ | |
| 22 | + private $pagination; | |
| 23 | 23 | |
| 24 | - /** @var bool */ | |
| 25 | - private $isMetaData = false; | |
| 24 | + /** @var bool */ | |
| 25 | + private $isMetaData = false; | |
| 26 | 26 | |
| 27 | - /** @var object */ | |
| 28 | - private $metaData; | |
| 27 | + /** @var object */ | |
| 28 | + private $metaData; | |
| 29 | 29 | |
| 30 | - /** @var object */ | |
| 31 | - private $data; | |
| 30 | + /** @var object */ | |
| 31 | + private $data; | |
| 32 | 32 | |
| 33 | 33 | /** @var object $body */ | 
| 34 | 34 | private $body; | 
| 35 | 35 | |
| 36 | - /* | |
| 36 | + /* | |
| 37 | 37 | * @param Response $response | 
| 38 | 38 | * @throws InstagramResponseException | 
| 39 | 39 | */ | 
| @@ -46,7 +46,7 @@ discard block | ||
| 46 | 46 | } | 
| 47 | 47 | } | 
| 48 | 48 | |
| 49 | - /* | |
| 49 | + /* | |
| 50 | 50 | * Set Values to the class members | 
| 51 | 51 | * @param Response $response | 
| 52 | 52 | * @return void | 
| @@ -57,25 +57,25 @@ discard block | ||
| 57 | 57 | $this->statusCode = (int) $response->getStatusCode(); | 
| 58 | 58 | $this->headers = $response->getHeaders(); | 
| 59 | 59 | $this->body = json_decode($response->getBody()->getContents()); | 
| 60 | - $this->extractBodyParts(); | |
| 60 | + $this->extractBodyParts(); | |
| 61 | 61 | } | 
| 62 | 62 | |
| 63 | - private function extractBodyParts() | |
| 64 | -	{ | |
| 65 | -		if (isset($this->body->pagination)) { | |
| 66 | - $this->isPagination = true; | |
| 67 | - $this->pagination = $this->body->pagination; | |
| 68 | - } | |
| 63 | + private function extractBodyParts() | |
| 64 | +    { | |
| 65 | +        if (isset($this->body->pagination)) { | |
| 66 | + $this->isPagination = true; | |
| 67 | + $this->pagination = $this->body->pagination; | |
| 68 | + } | |
| 69 | 69 | |
| 70 | -		if (isset($this->body->meta)) { | |
| 71 | - $this->isMetaData = true; | |
| 72 | - $this->metaData = $this->body->meta; | |
| 73 | - } | |
| 70 | +        if (isset($this->body->meta)) { | |
| 71 | + $this->isMetaData = true; | |
| 72 | + $this->metaData = $this->body->meta; | |
| 73 | + } | |
| 74 | 74 | |
| 75 | - $this->data = $this->body->data; | |
| 76 | - } | |
| 75 | + $this->data = $this->body->data; | |
| 76 | + } | |
| 77 | 77 | |
| 78 | - /* | |
| 78 | + /* | |
| 79 | 79 | * Get response | 
| 80 | 80 | * @return object|string | 
| 81 | 81 | */ | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | return $this->body; | 
| 85 | 85 | } | 
| 86 | 86 | |
| 87 | - /* | |
| 87 | + /* | |
| 88 | 88 | * Get Status Code | 
| 89 | 89 | * @return int | 
| 90 | 90 | */ | 
| @@ -93,7 +93,7 @@ discard block | ||
| 93 | 93 | return $this->statusCode; | 
| 94 | 94 | } | 
| 95 | 95 | |
| 96 | - /* | |
| 96 | + /* | |
| 97 | 97 | * Get specific header | 
| 98 | 98 | * @param string $header | 
| 99 | 99 | * @retrun string | 
| @@ -103,7 +103,7 @@ discard block | ||
| 103 | 103 | return isset($this->headers[$header]) ? $this->headers[$header] : []; | 
| 104 | 104 | } | 
| 105 | 105 | |
| 106 | - /* | |
| 106 | + /* | |
| 107 | 107 | * Get all headers | 
| 108 | 108 | * @retrun array | 
| 109 | 109 | */ | 
| @@ -112,57 +112,57 @@ discard block | ||
| 112 | 112 | return $this->headers; | 
| 113 | 113 | } | 
| 114 | 114 | |
| 115 | - /* | |
| 115 | + /* | |
| 116 | 116 | * Get data from body | 
| 117 | 117 | * @return object | 
| 118 | 118 | */ | 
| 119 | - public function getData() | |
| 120 | -	{ | |
| 121 | - return $this->data; | |
| 122 | - } | |
| 119 | + public function getData() | |
| 120 | +    { | |
| 121 | + return $this->data; | |
| 122 | + } | |
| 123 | 123 | |
| 124 | - /* | |
| 124 | + /* | |
| 125 | 125 | * Get Meta data | 
| 126 | 126 | * @return object | 
| 127 | 127 | */ | 
| 128 | - public function getMetaData() | |
| 129 | -	{ | |
| 130 | - return $this->metaData; | |
| 131 | - } | |
| 128 | + public function getMetaData() | |
| 129 | +    { | |
| 130 | + return $this->metaData; | |
| 131 | + } | |
| 132 | 132 | |
| 133 | - /* | |
| 133 | + /* | |
| 134 | 134 | * Get Meta data | 
| 135 | 135 | * @return object | 
| 136 | 136 | */ | 
| 137 | - public function getPagination() | |
| 138 | -	{ | |
| 139 | - return $this->pagination; | |
| 140 | - } | |
| 137 | + public function getPagination() | |
| 138 | +    { | |
| 139 | + return $this->pagination; | |
| 140 | + } | |
| 141 | 141 | |
| 142 | - /* | |
| 142 | + /* | |
| 143 | 143 | * Is Meta Data Present | 
| 144 | 144 | * @return bool | 
| 145 | 145 | */ | 
| 146 | - public function isMetaDataSet() | |
| 147 | -	{ | |
| 148 | - return $this->isMetaData; | |
| 149 | - } | |
| 146 | + public function isMetaDataSet() | |
| 147 | +    { | |
| 148 | + return $this->isMetaData; | |
| 149 | + } | |
| 150 | 150 | |
| 151 | - /* | |
| 151 | + /* | |
| 152 | 152 | * Is Pagination present | 
| 153 | 153 | * @return bool | 
| 154 | 154 | */ | 
| 155 | - public function isPaginationSet() | |
| 156 | -	{ | |
| 157 | - return $this->isPagination; | |
| 158 | - } | |
| 155 | + public function isPaginationSet() | |
| 156 | +    { | |
| 157 | + return $this->isPagination; | |
| 158 | + } | |
| 159 | 159 | |
| 160 | - /* | |
| 160 | + /* | |
| 161 | 161 | * Get Protocol version | 
| 162 | 162 | * @return string | 
| 163 | 163 | */ | 
| 164 | - public function getProtocol() | |
| 165 | -	{ | |
| 166 | - return $this->protocol; | |
| 167 | - } | |
| 164 | + public function getProtocol() | |
| 165 | +    { | |
| 166 | + return $this->protocol; | |
| 167 | + } | |
| 168 | 168 | } | 
| @@ -3,13 +3,13 @@ | ||
| 3 | 3 | |
| 4 | 4 | class InstagramException extends \Exception | 
| 5 | 5 |  { | 
| 6 | - /* | |
| 6 | + /* | |
| 7 | 7 | * Get Exception type | 
| 8 | 8 | * @return string | nul; | 
| 9 | 9 | */ | 
| 10 | - public function getType() | |
| 11 | -	{ | |
| 12 | - $message = json_decode($this->message); | |
| 13 | - return isset($message->Type) ? $message->Type : null; | |
| 14 | - } | |
| 10 | + public function getType() | |
| 11 | +    { | |
| 12 | + $message = json_decode($this->message); | |
| 13 | + return isset($message->Type) ? $message->Type : null; | |
| 14 | + } | |
| 15 | 15 | } | 
| @@ -114,10 +114,10 @@ | ||
| 114 | 114 | $e | 
| 115 | 115 | ); | 
| 116 | 116 | } | 
| 117 | - throw new InstagramException( | |
| 118 | -			json_encode(array("Type" => $exception['error_type'], "Message" => $exception['error_message'])), | |
| 119 | - $exception['error_code'], | |
| 120 | - $e | |
| 121 | - ); | |
| 117 | + throw new InstagramException( | |
| 118 | +            json_encode(array("Type" => $exception['error_type'], "Message" => $exception['error_message'])), | |
| 119 | + $exception['error_code'], | |
| 120 | + $e | |
| 121 | + ); | |
| 122 | 122 | } | 
| 123 | 123 | } |