Completed
Push — master ( 9c5d15...436069 )
by smiley
01:51
created
src/OAuthException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,4 +12,4 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\OAuth;
14 14
 
15
-class OAuthException extends \Exception{}
15
+class OAuthException extends \Exception {}
Please login to merge, or discard this patch.
examples/OAuth1Testprovider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 /**
18 18
  *
19 19
  */
20
-class OAuth1Testprovider extends OAuth1Provider{
20
+class OAuth1Testprovider extends OAuth1Provider {
21 21
 
22 22
 	protected $apiURL          = 'https://api.example.com';
23 23
 	protected $requestTokenURL = 'https://example.com/oauth/request_token';
Please login to merge, or discard this patch.
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/ProviderException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,4 +14,4 @@
 block discarded – undo
14 14
 
15 15
 use chillerlan\OAuth\OAuthException;
16 16
 
17
-class ProviderException extends OAuthException{}
17
+class ProviderException extends OAuthException {}
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 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,11 +74,9 @@
 block discarded – undo
74 74
 
75 75
 		if(!$data || !is_array($data)){
76 76
 			throw new ProviderException('unable to parse token response');
77
-		}
78
-		elseif(isset($data['error'])){
77
+		} elseif(isset($data['error'])){
79 78
 			throw new ProviderException('error retrieving access token: '.$data['error']);
80
-		}
81
-		elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
79
+		} elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
82 80
 			throw new ProviderException('token missing');
83 81
 		}
84 82
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use DateTime;
17 17
 use Psr\Http\Message\{RequestInterface, ResponseInterface, UriInterface};
18 18
 
19
-abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface{
19
+abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface {
20 20
 
21 21
 	/**
22 22
 	 * @var string
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 			->withHeader('Authorization', 'OAuth '.Psr7\build_http_query($params, true, ', ', '"'));
60 60
 		;
61 61
 
62
-		foreach($this->authHeaders as $header => $value){
62
+		foreach ($this->authHeaders as $header => $value) {
63 63
 			$request = $request->withAddedHeader($header, $value);
64 64
 		}
65 65
 
@@ -76,17 +76,17 @@  discard block
 block discarded – undo
76 76
 	protected function parseTokenResponse(ResponseInterface $response, bool $checkCallbackConfirmed = null):AccessToken{
77 77
 		parse_str($response->getBody()->getContents(), $data);
78 78
 
79
-		if(!$data || !is_array($data)){
79
+		if (!$data || !is_array($data)) {
80 80
 			throw new ProviderException('unable to parse token response');
81 81
 		}
82
-		elseif(isset($data['error'])){
82
+		elseif (isset($data['error'])) {
83 83
 			throw new ProviderException('error retrieving access token: '.$data['error']);
84 84
 		}
85
-		elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
85
+		elseif (!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])) {
86 86
 			throw new ProviderException('token missing');
87 87
 		}
88 88
 
89
-		if($checkCallbackConfirmed && (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] !== 'true')){
89
+		if ($checkCallbackConfirmed && (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] !== 'true')) {
90 90
 			throw new ProviderException('oauth callback unconfirmed');
91 91
 		}
92 92
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	protected function getSignature(string $url, array $params, string $method, string $accessTokenSecret = null):string{
132 132
 		$parseURL = parse_url($url);
133 133
 
134
-		if(!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)){
134
+		if (!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)) {
135 135
 			throw new ProviderException('getSignature: invalid url');
136 136
 		}
137 137
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 		$signatureParams = array_merge($query, $params);
141 141
 
142
-		if(isset($signatureParams['oauth_signature'])){
142
+		if (isset($signatureParams['oauth_signature'])) {
143 143
 			unset($signatureParams['oauth_signature']);
144 144
 		}
145 145
 
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/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.