@@ -83,10 +83,10 @@ |
||
| 83 | 83 | { |
| 84 | 84 | $data = json_decode($responseBody, true); |
| 85 | 85 | |
| 86 | - if (null === $data || ! is_array($data)) { |
|
| 86 | + if (null === $data || !is_array($data)) { |
|
| 87 | 87 | throw new TokenResponseException('Unable to parse response.'); |
| 88 | 88 | } elseif (isset($data['error'])) { |
| 89 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 89 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | $token = new StdOAuth2Token(); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | if (null === $data || !is_array($data)) { |
| 165 | 165 | throw new TokenResponseException('Unable to parse response.'); |
| 166 | 166 | } elseif (isset($data['error'])) { |
| 167 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 167 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | $token = new StdOAuth2Token(); |
@@ -193,9 +193,9 @@ discard block |
||
| 193 | 193 | throw new Exception("Redirect uri is mandatory for this request"); |
| 194 | 194 | } |
| 195 | 195 | $parameters['app_id'] = $this->credentials->getConsumerId(); |
| 196 | - $baseUrl = self::WWW_URL .$this->getApiVersionString(). '/dialog/' . $dialogPath; |
|
| 196 | + $baseUrl = self::WWW_URL.$this->getApiVersionString().'/dialog/'.$dialogPath; |
|
| 197 | 197 | $query = http_build_query($parameters); |
| 198 | - return new Uri($baseUrl . '?' . $query); |
|
| 198 | + return new Uri($baseUrl.'?'.$query); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /** |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | if (null === $data || !is_array($data)) { |
| 120 | 120 | throw new TokenResponseException('Unable to parse response.'); |
| 121 | 121 | } elseif (isset($data['error'])) { |
| 122 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 122 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 123 | 123 | } |
| 124 | 124 | //print $data['access_token'];exit; |
| 125 | 125 | |
@@ -79,9 +79,9 @@ |
||
| 79 | 79 | if (null === $data || !is_array($data)) { |
| 80 | 80 | throw new TokenResponseException('Unable to parse response.'); |
| 81 | 81 | } elseif (isset($data['message'])) { |
| 82 | - throw new TokenResponseException('Error in retrieving token: "' . $data['message'] . '"'); |
|
| 82 | + throw new TokenResponseException('Error in retrieving token: "'.$data['message'].'"'); |
|
| 83 | 83 | } elseif (isset($data['name'])) { |
| 84 | - throw new TokenResponseException('Error in retrieving token: "' . $data['name'] . '"'); |
|
| 84 | + throw new TokenResponseException('Error in retrieving token: "'.$data['name'].'"'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | $token = new StdOAuth2Token(); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | throw new TokenResponseException('Unable to parse response.'); |
| 46 | 46 | } elseif (isset($data['error'])) |
| 47 | 47 | { |
| 48 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 48 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $token = new StdOAuth2Token(); |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | protected function getExtraOAuthHeaders() |
| 73 | 73 | { |
| 74 | - $encodedCredentials = base64_encode($this->credentials->getConsumerId() . ':' . $this->credentials->getConsumerSecret()); |
|
| 75 | - return array('Authorization' => 'Basic ' . $encodedCredentials); |
|
| 74 | + $encodedCredentials = base64_encode($this->credentials->getConsumerId().':'.$this->credentials->getConsumerSecret()); |
|
| 75 | + return array('Authorization' => 'Basic '.$encodedCredentials); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | if (null === $data || !is_array($data)) { |
| 63 | 63 | throw new TokenResponseException('Unable to parse response.'); |
| 64 | 64 | } elseif (isset($data['error'])) { |
| 65 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 65 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | // Create token object. |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | protected function setBaseApiUri(StdOAuth2Token $token) |
| 98 | 98 | { |
| 99 | 99 | // Make request uri. |
| 100 | - $endpoint = 'https://login.mailchimp.com/oauth2/metadata?oauth_token='. $token->getAccessToken(); |
|
| 100 | + $endpoint = 'https://login.mailchimp.com/oauth2/metadata?oauth_token='.$token->getAccessToken(); |
|
| 101 | 101 | |
| 102 | 102 | // Grab meta data about the token. |
| 103 | 103 | $response = $this->httpClient->retrieveResponse(new Uri($endpoint), array(), array(), 'GET'); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $meta = json_decode($response, true); |
| 107 | 107 | |
| 108 | 108 | // Set base api uri. |
| 109 | - $this->baseApiUri = new Uri('https://'. $meta['dc'] .'.api.mailchimp.com/2.0/'); |
|
| 109 | + $this->baseApiUri = new Uri('https://'.$meta['dc'].'.api.mailchimp.com/2.0/'); |
|
| 110 | 110 | |
| 111 | 111 | // Allow chaining. |
| 112 | 112 | return $this; |
@@ -73,9 +73,9 @@ |
||
| 73 | 73 | if (null === $data || !is_array($data)) { |
| 74 | 74 | throw new TokenResponseException('Unable to parse response.'); |
| 75 | 75 | } elseif (isset($data['error_description'])) { |
| 76 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error_description'] . '"'); |
|
| 76 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error_description'].'"'); |
|
| 77 | 77 | } elseif (isset($data['error'])) { |
| 78 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 78 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | $token = new StdOAuth2Token(); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | if (null === $data || !is_array($data)) { |
| 75 | 75 | throw new TokenResponseException('Unable to parse response.'); |
| 76 | 76 | } elseif (isset($data['error'])) { |
| 77 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
| 77 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | protected function getExtraOAuthHeaders() |
| 105 | 105 | { |
| 106 | - return array('Authorization' => 'Basic ' . |
|
| 107 | - base64_encode($this->credentials->getConsumerId() . ':' . $this->credentials->getConsumerSecret())); |
|
| 106 | + return array('Authorization' => 'Basic '. |
|
| 107 | + base64_encode($this->credentials->getConsumerId().':'.$this->credentials->getConsumerSecret())); |
|
| 108 | 108 | } |
| 109 | 109 | } |
@@ -86,9 +86,9 @@ |
||
| 86 | 86 | $data = json_decode($responseBody, true); |
| 87 | 87 | |
| 88 | 88 | if (null === $data || !is_array($data)) { |
| 89 | - throw new TokenResponseException('Unable to parse response: "'.(isset($responseBody)?$responseBody:'NULL').'"'); |
|
| 89 | + throw new TokenResponseException('Unable to parse response: "'.(isset($responseBody) ? $responseBody : 'NULL').'"'); |
|
| 90 | 90 | } elseif (isset($data['error'])) { |
| 91 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '" : "'.$data['error_description'].'"'); |
|
| 91 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'" : "'.$data['error_description'].'"'); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | $token = new StdOAuth2Token(); |