Passed
Push — main ( 1522c6...4cc56e )
by smiley
01:57
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.
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/Storage/OAuthStorageException.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 OAuthStorageException extends OAuthException{}
17
+class OAuthStorageException extends OAuthException {}
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
@@ -78,11 +78,9 @@
 block discarded – undo
78 78
 
79 79
 		if(!$data || !is_array($data)){
80 80
 			throw new ProviderException('unable to parse token response');
81
-		}
82
-		elseif(isset($data['error'])){
81
+		} elseif(isset($data['error'])){
83 82
 			throw new ProviderException('error retrieving access token: '.$data['error']);
84
-		}
85
-		elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
83
+		} elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
86 84
 			throw new ProviderException('invalid token');
87 85
 		}
88 86
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 /**
22 22
  * Implements an abstract OAuth1 provider with all methods required by the OAuth1Interface.
23 23
  */
24
-abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface{
24
+abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface {
25 25
 
26 26
 	/**
27 27
 	 * The request OAuth1 token URL
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 			->withHeader('Content-Length', '0') // tumblr requires a content-length header set
61 61
 		;
62 62
 
63
-		foreach($this->authHeaders as $header => $value){
63
+		foreach ($this->authHeaders as $header => $value) {
64 64
 			$request = $request->withAddedHeader($header, $value);
65 65
 		}
66 66
 
@@ -81,20 +81,20 @@  discard block
 block discarded – undo
81 81
 	protected function parseTokenResponse(ResponseInterface $response, bool $checkCallbackConfirmed = null):AccessToken{
82 82
 		$data = $this->parseQuery(decompress_content($response));
83 83
 
84
-		if(!$data || !is_array($data)){
84
+		if (!$data || !is_array($data)) {
85 85
 			throw new ProviderException('unable to parse token response');
86 86
 		}
87
-		elseif(isset($data['error'])){
87
+		elseif (isset($data['error'])) {
88 88
 			throw new ProviderException('error retrieving access token: '.$data['error']);
89 89
 		}
90
-		elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
90
+		elseif (!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])) {
91 91
 			throw new ProviderException('invalid token');
92 92
 		}
93 93
 
94
-		if(
94
+		if (
95 95
 			$checkCallbackConfirmed
96 96
 			&& (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] !== 'true')
97
-		){
97
+		) {
98 98
 			throw new ProviderException('oauth callback unconfirmed');
99 99
 		}
100 100
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	protected function getSignature(string $url, array $params, string $method, string $accessTokenSecret = null):string{
146 146
 		$parseURL = parseUrl($url);
147 147
 
148
-		if(!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)){
148
+		if (!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)) {
149 149
 			throw new ProviderException('getSignature: invalid url');
150 150
 		}
151 151
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
 			$token->accessTokenSecret
204 204
 		);
205 205
 
206
-		if(isset($query['oauth_session_handle'])){
206
+		if (isset($query['oauth_session_handle'])) {
207 207
 			$parameters['oauth_session_handle'] = $query['oauth_session_handle']; // @codeCoverageIgnore
208 208
 		}
209 209
 
Please login to merge, or discard this patch.
src/Core/AccessToken.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
  * @property int    $expires
28 28
  * @property string $provider
29 29
  */
30
-class AccessToken extends SettingsContainerAbstract{
30
+class AccessToken extends SettingsContainerAbstract {
31 31
 
32 32
 	/**
33 33
 	 * Denotes an unknown end of life time.
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @param iterable|null $properties
82 82
 	 */
83
-	public function __construct(iterable $properties = null){
83
+	public function __construct(iterable $properties = null) {
84 84
 		parent::__construct($properties);
85 85
 
86 86
 		$this->setExpiry($this->expires);
@@ -103,16 +103,16 @@  discard block
 block discarded – undo
103 103
 	public function setExpiry(int $expires = null):AccessToken{
104 104
 		$now = time();
105 105
 
106
-		if($expires === 0 || $expires === $this::EOL_NEVER_EXPIRES){
106
+		if ($expires === 0 || $expires === $this::EOL_NEVER_EXPIRES) {
107 107
 			$this->expires = $this::EOL_NEVER_EXPIRES;
108 108
 		}
109
-		elseif($expires > $now){
109
+		elseif ($expires > $now) {
110 110
 			$this->expires = $expires;
111 111
 		}
112
-		elseif($expires > 0 && $expires < $this::EXPIRY_MAX){
112
+		elseif ($expires > 0 && $expires < $this::EXPIRY_MAX) {
113 113
 			$this->expires = $now + $expires;
114 114
 		}
115
-		else{
115
+		else {
116 116
 			$this->expires = $this::EOL_UNKNOWN;
117 117
 		}
118 118
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -105,14 +105,11 @@
 block discarded – undo
105 105
 
106 106
 		if($expires === 0 || $expires === $this::EOL_NEVER_EXPIRES){
107 107
 			$this->expires = $this::EOL_NEVER_EXPIRES;
108
-		}
109
-		elseif($expires > $now){
108
+		} elseif($expires > $now){
110 109
 			$this->expires = $expires;
111
-		}
112
-		elseif($expires > 0 && $expires < $this::EXPIRY_MAX){
110
+		} elseif($expires > 0 && $expires < $this::EXPIRY_MAX){
113 111
 			$this->expires = $now + $expires;
114
-		}
115
-		else{
112
+		} else{
116 113
 			$this->expires = $this::EOL_UNKNOWN;
117 114
 		}
118 115
 
Please login to merge, or discard this patch.
src/MagicAPI/ApiClientException.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
 use Exception;
14 14
 
15
-class ApiClientException extends Exception{}
15
+class ApiClientException extends Exception {}
Please login to merge, or discard this patch.
src/MagicAPI/EndpointMap.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
 use chillerlan\Settings\SettingsContainerAbstract;
14 14
 
15
-abstract class EndpointMap extends SettingsContainerAbstract implements EndpointMapInterface{
15
+abstract class EndpointMap extends SettingsContainerAbstract implements EndpointMapInterface {
16 16
 
17 17
 	protected string $API_BASE = '';
18 18
 
Please login to merge, or discard this patch.
src/MagicAPI/ApiClientInterface.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
 use Psr\Http\Message\ResponseInterface;
14 14
 
15
-interface ApiClientInterface{
15
+interface ApiClientInterface {
16 16
 
17 17
 	/**
18 18
 	 * Implements the Magic API client
Please login to merge, or discard this patch.
src/MagicAPI/EndpointMapInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,6 +15,6 @@
 block discarded – undo
15 15
 /**
16 16
  * @property string $API_BASE
17 17
  */
18
-interface EndpointMapInterface extends SettingsContainerInterface{
18
+interface EndpointMapInterface extends SettingsContainerInterface {
19 19
 
20 20
 }
Please login to merge, or discard this patch.