@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | // Find authentication source |
18 | 18 | if (is_null($state) || !array_key_exists(Twitter::AUTHID, $state)) { |
19 | - throw new Error\BadRequest('No data in state for ' . Twitter::AUTHID); |
|
19 | + throw new Error\BadRequest('No data in state for '.Twitter::AUTHID); |
|
20 | 20 | } |
21 | 21 | $sourceId = $state[Twitter::AUTHID]; |
22 | 22 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $source = Auth\Source::getById($sourceId); |
25 | 25 | if ($source === null) { |
26 | 26 | throw new Error\BadRequest( |
27 | - 'Could not find authentication source with id ' . var_export($sourceId, true) |
|
27 | + 'Could not find authentication source with id '.var_export($sourceId, true) |
|
28 | 28 | ); |
29 | 29 | } |
30 | 30 |
@@ -10,8 +10,8 @@ discard block |
||
10 | 10 | use SimpleSAML\Utils; |
11 | 11 | use Webmozart\Assert\Assert; |
12 | 12 | |
13 | -$default = dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/oauth/libextinc/OAuth.php'; |
|
14 | -$travis = dirname(dirname(dirname(dirname(__FILE__)))) . '/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php'; |
|
13 | +$default = dirname(dirname(dirname(dirname(dirname(__FILE__))))).'/oauth/libextinc/OAuth.php'; |
|
14 | +$travis = dirname(dirname(dirname(dirname(__FILE__)))).'/vendor/simplesamlphp/simplesamlphp/modules/oauth/libextinc/OAuth.php'; |
|
15 | 15 | |
16 | 16 | if (file_exists($default)) { |
17 | 17 | require_once($default); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | $configObject = Configuration::loadFromArray( |
75 | 75 | $config, |
76 | - 'authsources[' . var_export($this->authId, true) . ']' |
|
76 | + 'authsources['.var_export($this->authId, true).']' |
|
77 | 77 | ); |
78 | 78 | |
79 | 79 | $this->key = $configObject->getString('key'); |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | 'https://api.twitter.com/oauth/request_token', |
104 | 104 | ['oauth_callback' => $linkback] |
105 | 105 | ); |
106 | - Logger::debug("Got a request token from the OAuth service provider [" . |
|
107 | - $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); |
|
106 | + Logger::debug("Got a request token from the OAuth service provider [". |
|
107 | + $requestToken->key."] with the secret [".$requestToken->secret."]"); |
|
108 | 108 | |
109 | 109 | $state['authtwitter:authdata:requestToken'] = $requestToken; |
110 | 110 | Auth\State::saveState($state, self::STAGE_INIT); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $consumer = new Consumer($this->key, $this->secret); |
143 | 143 | |
144 | 144 | Logger::debug("oauth: Using this request token [". |
145 | - $requestToken->key . "] with the secret [" . $requestToken->secret . "]"); |
|
145 | + $requestToken->key."] with the secret [".$requestToken->secret."]"); |
|
146 | 146 | |
147 | 147 | // Replace the request token with an access token |
148 | 148 | $accessToken = $consumer->getAccessToken( |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | $requestToken, |
151 | 151 | $parameters |
152 | 152 | ); |
153 | - Logger::debug("Got an access token from the OAuth service provider [" . |
|
154 | - $accessToken->key . "] with the secret [" . $accessToken->secret . "]"); |
|
153 | + Logger::debug("Got an access token from the OAuth service provider [". |
|
154 | + $accessToken->key."] with the secret [".$accessToken->secret."]"); |
|
155 | 155 | |
156 | 156 | $verify_credentials_url = 'https://api.twitter.com/1.1/account/verify_credentials.json'; |
157 | 157 | if ($this->include_email) { |
158 | - $verify_credentials_url = $verify_credentials_url . '?include_email=true'; |
|
158 | + $verify_credentials_url = $verify_credentials_url.'?include_email=true'; |
|
159 | 159 | } |
160 | 160 | $userdata = $consumer->getUserInfo($verify_credentials_url, $accessToken); |
161 | 161 | |
@@ -169,13 +169,13 @@ discard block |
||
169 | 169 | $attributes = []; |
170 | 170 | foreach ($userdata as $key => $value) { |
171 | 171 | if (is_string($value)) { |
172 | - $attributes['twitter.' . $key] = [(string) $value]; |
|
172 | + $attributes['twitter.'.$key] = [(string) $value]; |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | - $attributes['twitter_at_screen_name'] = ['@' . $userdata['screen_name']]; |
|
177 | - $attributes['twitter_screen_n_realm'] = [$userdata['screen_name'] . '@twitter.com']; |
|
178 | - $attributes['twitter_targetedID'] = ['http://twitter.com!' . $userdata['id_str']]; |
|
176 | + $attributes['twitter_at_screen_name'] = ['@'.$userdata['screen_name']]; |
|
177 | + $attributes['twitter_screen_n_realm'] = [$userdata['screen_name'].'@twitter.com']; |
|
178 | + $attributes['twitter_targetedID'] = ['http://twitter.com!'.$userdata['id_str']]; |
|
179 | 179 | |
180 | 180 | $state['Attributes'] = $attributes; |
181 | 181 | } |