@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | $authorizationHeader = 'OAuth '; |
182 | 182 | $delimiter = ''; |
183 | 183 | foreach ($parameters as $key => $value) { |
184 | - $authorizationHeader .= $delimiter . rawurlencode($key) . '="' . rawurlencode($value) . '"'; |
|
184 | + $authorizationHeader .= $delimiter.rawurlencode($key).'="'.rawurlencode($value).'"'; |
|
185 | 185 | |
186 | 186 | $delimiter = ', '; |
187 | 187 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $delimiter = ''; |
226 | 226 | |
227 | 227 | foreach ($authParameters as $key => $value) { |
228 | - $authorizationHeader .= $delimiter . rawurlencode($key) . '="' . rawurlencode($value) . '"'; |
|
228 | + $authorizationHeader .= $delimiter.rawurlencode($key).'="'.rawurlencode($value).'"'; |
|
229 | 229 | $delimiter = ', '; |
230 | 230 | } |
231 | 231 | |
@@ -264,9 +264,9 @@ discard block |
||
264 | 264 | $characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; |
265 | 265 | |
266 | 266 | $nonce = ''; |
267 | - $maxRand = strlen($characters)-1; |
|
267 | + $maxRand = strlen($characters) - 1; |
|
268 | 268 | for ($i = 0; $i < $length; $i++) { |
269 | - $nonce.= $characters[rand(0, $maxRand)]; |
|
269 | + $nonce .= $characters[rand(0, $maxRand)]; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | return $nonce; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | if (null === $data || !is_array($data)) { |
78 | 78 | throw new TokenResponseException('Unable to parse response.'); |
79 | 79 | } elseif (isset($data['error'])) { |
80 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
80 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $token = new StdOAuth1Token(); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | throw new TokenResponseException('Unable to parse response.'); |
101 | 101 | } elseif (isset($data['error'])) { |
102 | 102 | throw new TokenResponseException( |
103 | - 'Error in retrieving token: "' . $data['error'] . '"' |
|
103 | + 'Error in retrieving token: "'.$data['error'].'"' |
|
104 | 104 | ); |
105 | 105 | } |
106 | 106 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | if ($data === null || !is_array($data)) { |
61 | 61 | throw new TokenResponseException('Unable to parse response.'); |
62 | 62 | } elseif (isset($data['error'])) { |
63 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
63 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | $token = new StdOAuth1Token(); |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | const ENDPOINT_AUTHENTICATE = "https://api.twitter.com/oauth/authenticate"; |
18 | 18 | const ENDPOINT_AUTHORIZE = "https://api.twitter.com/oauth/authorize"; |
19 | 19 | |
20 | - protected $authorizationEndpoint = self::ENDPOINT_AUTHENTICATE; |
|
20 | + protected $authorizationEndpoint = self::ENDPOINT_AUTHENTICATE; |
|
21 | 21 | |
22 | 22 | public function __construct( |
23 | 23 | CredentialsInterface $credentials, |
@@ -100,11 +100,11 @@ discard block |
||
100 | 100 | parse_str($responseBody, $data); |
101 | 101 | |
102 | 102 | if (null === $data || !is_array($data)) { |
103 | - throw new TokenResponseException('Unable to parse response: ' . $responseBody); |
|
103 | + throw new TokenResponseException('Unable to parse response: '.$responseBody); |
|
104 | 104 | } elseif (isset($data['error'])) { |
105 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
105 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
106 | 106 | } elseif (!isset($data["oauth_token"]) || !isset($data["oauth_token_secret"])) { |
107 | - throw new TokenResponseException('Invalid response. OAuth Token data not set: ' . $responseBody); |
|
107 | + throw new TokenResponseException('Invalid response. OAuth Token data not set: '.$responseBody); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | $token = new StdOAuth1Token(); |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function getRequestTokenEndpoint() |
37 | 37 | { |
38 | - $uri = new Uri($this->baseApiUri . 'oauth/request_token'); |
|
38 | + $uri = new Uri($this->baseApiUri.'oauth/request_token'); |
|
39 | 39 | $scopes = $this->getScopes(); |
40 | 40 | |
41 | 41 | if (count($scopes)) { |
42 | - $uri->setQuery('scope=' . implode('%20', $scopes)); |
|
42 | + $uri->setQuery('scope='.implode('%20', $scopes)); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | return $uri; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function getAccessTokenEndpoint() |
60 | 60 | { |
61 | - return new Uri($this->baseApiUri . 'oauth/access_token'); |
|
61 | + return new Uri($this->baseApiUri.'oauth/access_token'); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if (null === $data || !is_array($data)) { |
88 | 88 | throw new TokenResponseException('Unable to parse response.'); |
89 | 89 | } elseif (isset($data['error'])) { |
90 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
90 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $token = new StdOAuth1Token(); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | if (null === $data || !is_array($data)) { |
79 | 79 | throw new TokenResponseException('Unable to parse response.'); |
80 | 80 | } elseif ($errors) { |
81 | - throw new TokenResponseException('Error in retrieving token: "' . $errors->error_name . '"'); |
|
81 | + throw new TokenResponseException('Error in retrieving token: "'.$errors->error_name.'"'); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | $token = new StdOAuth1Token(); |
@@ -111,11 +111,11 @@ |
||
111 | 111 | throw new TokenResponseException('Unable to parse response.'); |
112 | 112 | } elseif (isset($data['error_description'])) { |
113 | 113 | throw new TokenResponseException( |
114 | - 'Error in retrieving token: "' . $data['error_description'] . '"' |
|
114 | + 'Error in retrieving token: "'.$data['error_description'].'"' |
|
115 | 115 | ); |
116 | 116 | } elseif (isset($data['error'])) { |
117 | 117 | throw new TokenResponseException( |
118 | - 'Error in retrieving token: "' . $data['error'] . '"' |
|
118 | + 'Error in retrieving token: "'.$data['error'].'"' |
|
119 | 119 | ); |
120 | 120 | } |
121 | 121 |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if (null === $data || !is_array($data)) { |
69 | 69 | throw new TokenResponseException('Unable to parse response.'); |
70 | 70 | } elseif (isset($data['error'])) { |
71 | - throw new TokenResponseException('Error in retrieving token: "' . $data['error'] . '"'); |
|
71 | + throw new TokenResponseException('Error in retrieving token: "'.$data['error'].'"'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | $token = new StdOAuth2Token(); |
@@ -93,6 +93,6 @@ discard block |
||
93 | 93 | */ |
94 | 94 | protected function getExtraOAuthHeaders() |
95 | 95 | { |
96 | - return array('Authorization' => 'Basic ' . $this->credentials->getConsumerSecret()); |
|
96 | + return array('Authorization' => 'Basic '.$this->credentials->getConsumerSecret()); |
|
97 | 97 | } |
98 | 98 | } |