Passed
Push — master ( 74736c...41514f )
by smiley
02:15
created
src/Core/OAuthInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
  * @property string $serviceName
20 20
  * @property string $userRevokeURL
21 21
  */
22
-interface OAuthInterface{
22
+interface OAuthInterface {
23 23
 
24 24
 	/**
25 25
 	 * @param array $params
Please login to merge, or discard this patch.
src/Core/TokenExpires.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface TokenExpires{
15
+interface TokenExpires {
16 16
 
17 17
 }
Please login to merge, or discard this patch.
src/Core/CSRFToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface CSRFToken{
15
+interface CSRFToken {
16 16
 
17 17
 }
Please login to merge, or discard this patch.
src/Core/OAuth1Provider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 use chillerlan\HTTP\HTTPResponseInterface;
16 16
 use DateTime;
17 17
 
18
-abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface{
18
+abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface {
19 19
 
20 20
 	/**
21 21
 	 * @var string
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 * @return \chillerlan\OAuth\Core\AccessToken
47 47
 	 */
48 48
 	public function getRequestToken():AccessToken {
49
-		$params   = $this->getRequestTokenHeaderParams();
49
+		$params = $this->getRequestTokenHeaderParams();
50 50
 
51 51
 		return $this->parseTokenResponse(
52 52
 			$this->httpPOST(
@@ -71,19 +71,19 @@  discard block
 block discarded – undo
71 71
 	protected function parseTokenResponse(HTTPResponseInterface $response, bool $checkCallbackConfirmed = null):AccessToken {
72 72
 		parse_str($response->body, $data);
73 73
 
74
-		if(!$data || !is_array($data)){
74
+		if (!$data || !is_array($data)) {
75 75
 			throw new ProviderException('unable to parse token response');
76 76
 		}
77
-		elseif(isset($data['error'])){
77
+		elseif (isset($data['error'])) {
78 78
 			throw new ProviderException('error retrieving access token: '.$data['error']);
79 79
 		}
80
-		elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
80
+		elseif (!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])) {
81 81
 			throw new ProviderException('token missing');
82 82
 		}
83 83
 
84
-		if(($checkCallbackConfirmed ?? false)
84
+		if (($checkCallbackConfirmed ?? false)
85 85
 		   && (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] !== 'true')
86
-		){
86
+		) {
87 87
 			throw new ProviderException('oauth callback unconfirmed');
88 88
 		}
89 89
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	public function getSignature(string $url, array $params, string $method = null):string {
147 147
 		$parseURL = parse_url($url);
148 148
 
149
-		if(!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)){
149
+		if (!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)) {
150 150
 			throw new ProviderException('getSignature: invalid url');
151 151
 		}
152 152
 
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
 	 *
171 171
 	 * @return string
172 172
 	 */
173
-	protected function getSignatureData(string $signatureURL, array $signatureParams, string $method){
173
+	protected function getSignatureData(string $signatureURL, array $signatureParams, string $method) {
174 174
 
175
-		if(isset($signatureParams['oauth_signature'])){
175
+		if (isset($signatureParams['oauth_signature'])) {
176 176
 			unset($signatureParams['oauth_signature']);
177 177
 		}
178 178
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 	public function getAccessToken(string $token, string $verifier, string $tokenSecret = null):AccessToken {
196 196
 		$this->tokenSecret = $tokenSecret;
197 197
 
198
-		if(empty($this->tokenSecret)){
198
+		if (empty($this->tokenSecret)) {
199 199
 			$this->tokenSecret = $this->storage->getAccessToken($this->serviceName)->requestTokenSecret;
200 200
 		}
201 201
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 
232 232
 		$parameters['oauth_signature'] = $this->getSignature($url, array_merge($params ?? [], $parameters), $method);
233 233
 
234
-		if(isset($params['oauth_session_handle'])){
234
+		if (isset($params['oauth_session_handle'])) {
235 235
 			$parameters['oauth_session_handle'] = $params['oauth_session_handle'];
236 236
 			unset($params['oauth_session_handle']);
237 237
 		}
Please login to merge, or discard this patch.
src/Core/OAuth2ClientCredentialsTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
  * @property string                                          $accessTokenURL
20 20
  * @property \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
21 21
  */
22
-trait OAuth2ClientCredentialsTrait{
22
+trait OAuth2ClientCredentialsTrait {
23 23
 
24 24
 	/**
25 25
 	 * @param array $scopes
Please login to merge, or discard this patch.
src/Core/TokenRefresh.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface TokenRefresh{
15
+interface TokenRefresh {
16 16
 
17 17
 	/**
18 18
 	 * @param \chillerlan\OAuth\Core\AccessToken|null $token
Please login to merge, or discard this patch.
src/Core/CSRFTokenTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  * @property string                                          $serviceName
19 19
  * @property \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
20 20
  */
21
-trait CSRFTokenTrait{
21
+trait CSRFTokenTrait {
22 22
 
23 23
 	/**
24 24
 	 * @param string|null $state
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
28 28
 	 */
29 29
 	protected function checkState(string $state = null):OAuth2Interface{
30 30
 
31
-		if(empty($state) || !$this->storage->hasCSRFState($this->serviceName)){
31
+		if (empty($state) || !$this->storage->hasCSRFState($this->serviceName)) {
32 32
 			throw new ProviderException('invalid state for '.$this->serviceName);
33 33
 		}
34 34
 
35 35
 		$knownState = $this->storage->getCSRFState($this->serviceName);
36 36
 
37
-		if(!hash_equals($knownState, $state)){
37
+		if (!hash_equals($knownState, $state)) {
38 38
 			throw new ProviderException('invalid CSRF state: '.$this->serviceName.' '.$state);
39 39
 		}
40 40
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 */
50 50
 	protected function setState(array $params):array {
51 51
 
52
-		if(!isset($params['state'])){
52
+		if (!isset($params['state'])) {
53 53
 			$params['state'] = sha1(random_bytes(256));
54 54
 		}
55 55
 
Please login to merge, or discard this patch.
src/Core/OAuth1Interface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface OAuth1Interface extends OAuthInterface{
15
+interface OAuth1Interface extends OAuthInterface {
16 16
 
17 17
 	/**
18 18
 	 * @return \chillerlan\OAuth\Core\AccessToken
Please login to merge, or discard this patch.
src/Core/AccessTokenForRefresh.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,6 +12,6 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth\Core;
14 14
 
15
-interface AccessTokenForRefresh{
15
+interface AccessTokenForRefresh {
16 16
 
17 17
 }
Please login to merge, or discard this patch.