Passed
Push — main ( bd088f...02f08d )
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.
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   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 /**
23 23
  * Implements an abstract OAuth1 provider with all methods required by the OAuth1Interface.
24 24
  */
25
-abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface{
25
+abstract class OAuth1Provider extends OAuthProvider implements OAuth1Interface {
26 26
 
27 27
 	/**
28 28
 	 * The request OAuth1 token URL
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 			->withHeader('Accept-Encoding', 'identity')
65 65
 		;
66 66
 
67
-		foreach($this->authHeaders as $header => $value){
67
+		foreach ($this->authHeaders as $header => $value) {
68 68
 			$request = $request->withAddedHeader($header, $value);
69 69
 		}
70 70
 
@@ -85,20 +85,20 @@  discard block
 block discarded – undo
85 85
 	protected function parseTokenResponse(ResponseInterface $response, bool $checkCallbackConfirmed = null):AccessToken{
86 86
 		parse_str(decompress_content($response), $data);
87 87
 
88
-		if(!$data || !is_array($data)){
88
+		if (!$data || !is_array($data)) {
89 89
 			throw new ProviderException('unable to parse token response');
90 90
 		}
91
-		elseif(isset($data['error'])){
91
+		elseif (isset($data['error'])) {
92 92
 			throw new ProviderException('error retrieving access token: '.$data['error']);
93 93
 		}
94
-		elseif(!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])){
94
+		elseif (!isset($data['oauth_token']) || !isset($data['oauth_token_secret'])) {
95 95
 			throw new ProviderException('invalid token');
96 96
 		}
97 97
 
98
-		if(
98
+		if (
99 99
 			$checkCallbackConfirmed
100 100
 			&& (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] !== 'true')
101
-		){
101
+		) {
102 102
 			throw new ProviderException('oauth callback unconfirmed');
103 103
 		}
104 104
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	protected function getSignature(string $url, array $params, string $method, string $accessTokenSecret = null):string{
149 149
 		$parseURL = parse_url($url);
150 150
 
151
-		if(!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)){
151
+		if (!isset($parseURL['host']) || !isset($parseURL['scheme']) || !in_array($parseURL['scheme'], ['http', 'https'], true)) {
152 152
 			throw new ProviderException('getSignature: invalid url');
153 153
 		}
154 154
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 		$signatureParams = array_merge($query, $params);
158 158
 
159
-		if(isset($signatureParams['oauth_signature'])){
159
+		if (isset($signatureParams['oauth_signature'])) {
160 160
 			unset($signatureParams['oauth_signature']);
161 161
 		}
162 162
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 			$token->accessTokenSecret
209 209
 		);
210 210
 
211
-		if(isset($query['oauth_session_handle'])){
211
+		if (isset($query['oauth_session_handle'])) {
212 212
 			$parameters['oauth_session_handle'] = $query['oauth_session_handle']; // @codeCoverageIgnore
213 213
 		}
214 214
 
Please login to merge, or discard this patch.
src/OAuthOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,6 +40,6 @@
 block discarded – undo
40 40
  * @property int        $retries
41 41
  * @property array      $curl_multi_options
42 42
  */
43
-class OAuthOptions extends SettingsContainerAbstract{
43
+class OAuthOptions extends SettingsContainerAbstract {
44 44
 	use OAuthOptionsTrait, HTTPOptionsTrait;
45 45
 }
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.