Passed
Push — main ( 129f19...5ed128 )
by smiley
31:18
created
src/Imgur/ImgurEndpoints.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
 /**
18 18
  */
19
-class ImgurEndpoints extends EndpointMap{
19
+class ImgurEndpoints extends EndpointMap {
20 20
 
21 21
 	protected array $me = [
22 22
 		'path'          => '/3/account/me',
Please login to merge, or discard this patch.
src/Discord/DiscordEndpoints.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
  * @link https://discordapp.com/developers/docs/intro
19 19
  * @todo
20 20
  */
21
-class DiscordEndpoints extends EndpointMap{
21
+class DiscordEndpoints extends EndpointMap {
22 22
 
23 23
 	protected array $me = [
24 24
 		'path'          => '/users/@me',
Please login to merge, or discard this patch.
src/NPR/NPROneEndpoints.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
  * @link https://dev.npr.org/api/
19 19
  */
20
-class NPROneEndpoints extends EndpointMap{
20
+class NPROneEndpoints extends EndpointMap {
21 21
 
22 22
 	protected string $API_BASE = 'https://'; // i hate this so much
23 23
 
Please login to merge, or discard this patch.
src/PayPal/PayPalSandbox.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 /**
16 16
  * @method \Psr\Http\Message\ResponseInterface me(array $params = ['schema'])
17 17
  */
18
-class PayPalSandbox extends PayPal{
18
+class PayPalSandbox extends PayPal {
19 19
 
20 20
 	protected string $authURL        = 'https://www.sandbox.paypal.com/connect';
21 21
 	protected string $accessTokenURL = 'https://api.sandbox.paypal.com/v1/oauth2/token';
Please login to merge, or discard this patch.
src/PayPal/PayPalEndpoints.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
  * @link https://developer.paypal.com/docs/api/identity/v1/
19 19
  */
20
-class PayPalEndpoints extends EndpointMap{
20
+class PayPalEndpoints extends EndpointMap {
21 21
 
22 22
 	protected array $me = [
23 23
 		'path'          => '/v1/identity/oauth2/userinfo',
Please login to merge, or discard this patch.
src/GitLab/GitLabV4Endpoints.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
  * @link https://docs.gitlab.com/ee/api/README.html
19 19
  */
20
-class GitLabV4Endpoints extends EndpointMap{
20
+class GitLabV4Endpoints extends EndpointMap {
21 21
 
22 22
 	protected string $API_BASE = '/v4';
23 23
 
Please login to merge, or discard this patch.
src/MailChimp/MailChimp.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  * @method \Psr\Http\Message\ResponseInterface ping()
30 30
  * @method \Psr\Http\Message\ResponseInterface root(array $params = ['fields', 'exclude_fields'])
31 31
  */
32
-class MailChimp extends OAuth2Provider implements CSRFToken{
32
+class MailChimp extends OAuth2Provider implements CSRFToken {
33 33
 
34 34
 	protected const API_BASE          = 'https://%s.api.mailchimp.com/3.0';
35 35
 	protected const METADATA_ENDPOINT = 'https://login.mailchimp.com/oauth2/metadata';
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 		$token ??= $this->storage->getAccessToken($this->serviceName);
53 53
 
54
-		if(!$token instanceof AccessToken){
54
+		if (!$token instanceof AccessToken) {
55 55
 			throw new OAuthException('invalid token'); // @codeCoverageIgnore
56 56
 		}
57 57
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 		$response = $this->http->sendRequest($request);
64 64
 
65
-		if($response->getStatusCode() !== 200){
65
+		if ($response->getStatusCode() !== 200) {
66 66
 			throw new OAuthException('metadata response error'); // @codeCoverageIgnore
67 67
 		}
68 68
 
Please login to merge, or discard this patch.
src/PayPal/PayPal.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,21 +47,21 @@  discard block
 block discarded – undo
47 47
 	protected function parseTokenResponse(ResponseInterface $response):AccessToken{
48 48
 		$data = json_decode(decompress_content($response), true);
49 49
 
50
-		if(!is_array($data)){
50
+		if (!is_array($data)) {
51 51
 			throw new ProviderException('unable to parse token response');
52 52
 		}
53 53
 
54
-		foreach(['error_description', 'error'] as $field){
55
-			if(isset($data[$field])){
54
+		foreach (['error_description', 'error'] as $field) {
55
+			if (isset($data[$field])) {
56 56
 				throw new ProviderException('error retrieving access token: "'.$data[$field].'"');
57 57
 			}
58 58
 		}
59 59
 
60 60
 		// @codeCoverageIgnoreStart
61
-		if(isset($data['name'], $data['message'])){
61
+		if (isset($data['name'], $data['message'])) {
62 62
 			$msg = sprintf('error retrieving access token: "%s" [%s]', $data['message'], $data['name']);
63 63
 
64
-			if(isset($data['links']) && is_array($data['links'])){
64
+			if (isset($data['links']) && is_array($data['links'])) {
65 65
 				$msg .= "\n".implode("\n", array_column($data['links'], 'href'));
66 66
 			}
67 67
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		}
70 70
 		// @codeCoverageIgnoreEnd
71 71
 
72
-		if(!isset($data['access_token'])){
72
+		if (!isset($data['access_token'])) {
73 73
 			throw new ProviderException('token missing');
74 74
 		}
75 75
 
Please login to merge, or discard this patch.
src/Steam/SteamOpenID.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
  * @method \Psr\Http\Message\ResponseInterface steamWebAPIUtilGetSupportedAPIList()
50 50
  * @method \Psr\Http\Message\ResponseInterface storeServiceGetAppList(array $params = ['if_modified_since', 'have_description_language', 'include_games', 'include_dlc', 'include_software', 'include_videos', 'include_hardware', 'last_appid', 'max_results'])
51 51
  */
52
-class SteamOpenID extends OAuthProvider{
52
+class SteamOpenID extends OAuthProvider {
53 53
 
54 54
 	protected string $authURL         = 'https://steamcommunity.com/openid/login';
55 55
 	protected string $accessTokenURL  = 'https://steamcommunity.com/openid/login';
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 			'openid.sig'  => $received['openid_sig'],
92 92
 		];
93 93
 
94
-		foreach(explode(',', $received['openid_signed']) as $item){
94
+		foreach (explode(',', $received['openid_signed']) as $item) {
95 95
 			$body['openid.'.$item] = $received['openid_'.$item];
96 96
 		}
97 97
 
@@ -126,11 +126,11 @@  discard block
 block discarded – undo
126 126
 	protected function parseTokenResponse(ResponseInterface $response):AccessToken{
127 127
 		$data = explode("\x0a", (string)$response->getBody());
128 128
 
129
-		if(!isset($data[1]) || strpos($data[1], 'is_valid') !== 0){
129
+		if (!isset($data[1]) || strpos($data[1], 'is_valid') !== 0) {
130 130
 			throw new ProviderException('unable to parse token response');
131 131
 		}
132 132
 
133
-		if($data[1] !== 'is_valid:true'){
133
+		if ($data[1] !== 'is_valid:true') {
134 134
 			throw new ProviderException('invalid id');
135 135
 		}
136 136
 
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
 		$params = ['key' => $this->options->secret];
153 153
 
154 154
 		// the steamid parameter does not necessarily specify the current user, so add it only when it's not already set
155
-		if(strpos(parse_url($uri, PHP_URL_QUERY), 'steamid=') === false){ // php8: str_contains
156
-			$params['steamid']= $token->accessToken;
155
+		if (strpos(parse_url($uri, PHP_URL_QUERY), 'steamid=') === false) { // php8: str_contains
156
+			$params['steamid'] = $token->accessToken;
157 157
 		}
158 158
 
159 159
 		return $request->withUri($this->uriFactory->createUri(merge_query($uri, $params)));
Please login to merge, or discard this patch.