Skip to content

Commit

Permalink
Fix code styling
Browse files Browse the repository at this point in the history
  • Loading branch information
atymic authored and github-actions[bot] committed Feb 13, 2024
1 parent 177a48a commit 3e3df8d
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/DocuSign/DocuSignExtendSocialite.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class DocuSignExtendSocialite
/**
* Register the provider.
*
* @param SocialiteWasCalled $socialiteWasCalled
* @param SocialiteWasCalled $socialiteWasCalled
*/
public function handle(SocialiteWasCalled $socialiteWasCalled): void
{
Expand Down
19 changes: 8 additions & 11 deletions src/DocuSign/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,62 +3,59 @@
namespace SocialiteProviders\DocuSign;

use GuzzleHttp\RequestOptions;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use SocialiteProviders\Manager\OAuth2\AbstractProvider;
use SocialiteProviders\Manager\OAuth2\User;

class Provider extends AbstractProvider
{

public const IDENTIFIER = 'DOCUSIGN';

protected $usesPKCE = true;

protected $scopes = ['signature'];

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function getAuthUrl($state)
{
return $this->buildAuthUrlFromBase('https://account-d.docusign.com/oauth/auth', $state);
}

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function getTokenUrl()
{
return "https://account-d.docusign.com/oauth/token";
return 'https://account-d.docusign.com/oauth/token';
}

public function getAccessTokenResponse($code)
{
$response = $this->getHttpClient()->post($this->getTokenUrl(), [
RequestOptions::HEADERS => ['Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)],
RequestOptions::HEADERS => ['Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret)],
RequestOptions::FORM_PARAMS => $this->getTokenFields($code),
]);

return json_decode((string)$response->getBody(), true);
return json_decode((string) $response->getBody(), true);
}

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function getUserByToken($token)
{
$response = $this->getHttpClient()->get('https://account-d.docusign.com/oauth/userinfo', [
RequestOptions::HEADERS => [
'Authorization' => 'Bearer ' . $token,
'Authorization' => 'Bearer '.$token,
],
]);

return json_decode($response->getBody(), true);
}

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function mapUserToObject(array $user)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Indeed/IndeedExtendSocialite.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class IndeedExtendSocialite
/**
* Register the provider.
*
* @param SocialiteWasCalled $socialiteWasCalled
* @param SocialiteWasCalled $socialiteWasCalled
*/
public function handle(SocialiteWasCalled $socialiteWasCalled): void
{
Expand Down
12 changes: 6 additions & 6 deletions src/Indeed/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,37 @@ class Provider extends AbstractProvider
protected $scopes = ['email', 'offline_access'];

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function getAuthUrl($state)
{
return $this->buildAuthUrlFromBase('https://secure.indeed.com/oauth/v2/authorize', $state);
}

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function getTokenUrl()
{
return "https://apis.indeed.com/oauth/v2/tokens";
return 'https://apis.indeed.com/oauth/v2/tokens';
}

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function getUserByToken($token)
{
$response = $this->getHttpClient()->get('https://secure.indeed.com/v2/api/userinfo', [
RequestOptions::HEADERS => [
'Authorization' => 'Bearer ' . $token,
'Authorization' => 'Bearer '.$token,
],
]);

return json_decode($response->getBody(), true);
}

/**
* @inheritDoc
* {@inheritDoc}
*/
protected function mapUserToObject(array $user)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Jira/RsaSha1Signature.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function setCertPath(string $certPath): void
/**
* Set cert passphrase.
*
* @param $certPassphrase
* @param $certPassphrase
*/
public function setCertPassphrase($certPassphrase)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Jira/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Server extends BaseServer
* @param ClientCredentialsInterface|array $clientCredentials
* @param SignatureInterface $signature
*/
public function __construct($clientCredentials, SignatureInterface $signature = null)
public function __construct($clientCredentials, ?SignatureInterface $signature = null)
{
// Pass through an array or client credentials, we don't care
if (is_array($clientCredentials)) {
Expand Down
4 changes: 2 additions & 2 deletions src/JumpCloud/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace SocialiteProviders\JumpCloud;

use Illuminate\Support\Arr;
use GuzzleHttp\RequestOptions;
use Illuminate\Support\Arr;
use SocialiteProviders\Manager\OAuth2\AbstractProvider;
use SocialiteProviders\Manager\OAuth2\User;

Expand Down Expand Up @@ -33,7 +33,7 @@ protected function getTokenUrl()
public function getAccessToken($code)
{
$response = $this->getHttpClient()->post($this->getTokenUrl(), [
'headers' => ['Authorization' => 'Basic ' . base64_encode($this->clientId . ':' . $this->clientSecret)],
'headers' => ['Authorization' => 'Basic '.base64_encode($this->clientId.':'.$this->clientSecret)],
'body' => $this->getTokenFields($code),
]);

Expand Down
2 changes: 1 addition & 1 deletion src/Keycloak/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function mapUserToObject(array $user)
*
* @throws InvalidArgumentException
*/
public function getLogoutUrl(string $redirectUri = null, string $clientId = null, string $idTokenHint = null, ...$additionalParameters): string
public function getLogoutUrl(?string $redirectUri = null, ?string $clientId = null, ?string $idTokenHint = null, ...$additionalParameters): string
{
$logoutUrl = $this->getBaseUrl().'/protocol/openid-connect/logout';

Expand Down
11 changes: 6 additions & 5 deletions src/MercadoPago/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ public static function additionalConfigKeys()
}

/**
* {@inheritdoc }
* {@inheritdoc}
*/
protected function getCodeFields($state = null): array
{
$fields = [
'client_id' => $this->clientId,
'client_id' => $this->clientId,
'response_type' => 'code',
'platform_id' => 'mp',
'state' => $state,
'redirect_uri' => $this->redirectUrl,
'platform_id' => 'mp',
'state' => $state,
'redirect_uri' => $this->redirectUrl,
];

return array_merge($fields, $this->parameters);
Expand All @@ -62,6 +62,7 @@ protected function getCodeFields($state = null): array
protected function getAuthUrl($state)
{
$url = self::DOMAIN[config('services.mercadopago.country')] ?? 'https://auth.mercadopago.com';

return $this->buildAuthUrlFromBase($url.'/authorization', $state);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Okta/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ protected function mapUserToObject(array $user)
* @param string|null $state
* @return string
*/
public function getLogoutUrl(string $idToken, string $redirectUri = null, string $state = null)
public function getLogoutUrl(string $idToken, ?string $redirectUri = null, ?string $state = null)
{
$url = $this->getOktaServerUrl().'v1/logout';

Expand Down
2 changes: 1 addition & 1 deletion src/Onelogin/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ protected function mapUserToObject(array $user)
* @param string|null $state
* @return string
*/
public function getLogoutUrl(string $idToken, string $redirectUri = null, bool $logout = true, string $state = null)
public function getLogoutUrl(string $idToken, ?string $redirectUri = null, bool $logout = true, ?string $state = null)
{
$url = $this->getOneloginUrl().'/logout';

Expand Down
5 changes: 3 additions & 2 deletions src/Orcid/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,9 @@ protected function getEmail($user)
*/
protected function mapUserToObject(array $user)
{
$given_name = $user['person']['name']['given-names']['value'] ?? "";
$family_name = $user['person']['name']['family-name']['value'] ?? "";
$given_name = $user['person']['name']['given-names']['value'] ?? '';
$family_name = $user['person']['name']['family-name']['value'] ?? '';

return (new User())->setRaw($user)->map([
$this->getConfig('uid_fieldname', 'id') => $user['orcid-identifier']['path'],
'nickname' => $given_name,
Expand Down
2 changes: 1 addition & 1 deletion src/Shopify/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public static function additionalConfigKeys()
* Work out the shopify domain based on either the
* `subdomain` config setting or the current request.
*
* @param string $uri URI to append to the domain
* @param string $uri URI to append to the domain
* @return string The fully qualified *.myshopify.com url
*/
private function shopifyUrl($uri = null)
Expand Down
12 changes: 6 additions & 6 deletions src/Slack/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ public function user()
protected function mapUserToObject(array $user)
{
return (new User())->setRaw($user)->map([
'id' => Arr::get($user, 'user.id'),
'name' => Arr::get($user, 'user.name'),
'email' => Arr::get($user, 'user.email'),
'avatar' => Arr::get($user, 'user.image_512'),
'id' => Arr::get($user, 'user.id'),
'name' => Arr::get($user, 'user.name'),
'email' => Arr::get($user, 'user.email'),
'avatar' => Arr::get($user, 'user.image_512'),
'organization_id' => Arr::get($user, 'team.id'),
]);
}

public function getAccessTokenResponse($code)
{
$response = $this->getHttpClient()->post($this->getTokenUrl(), [
RequestOptions::HEADERS => $this->getTokenHeaders($code),
RequestOptions::HEADERS => $this->getTokenHeaders($code),
RequestOptions::FORM_PARAMS => $this->getTokenFields($code),
]);

Expand All @@ -101,7 +101,7 @@ protected function getTokenUrl()
protected function getUserByToken($token)
{
$response = $this->getHttpClient()->get('https://slack.com/api/users.identity', [
RequestOptions::HEADERS => ['Authorization' => 'Bearer ' . $token],
RequestOptions::HEADERS => ['Authorization' => 'Bearer '.$token],
]);

return json_decode($response->getBody(), true);
Expand Down
6 changes: 3 additions & 3 deletions src/StartGg/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function getUserByToken($token): array
[
RequestOptions::HEADERS => [
'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $token,
'Authorization' => 'Bearer '.$token,
],
RequestOptions::FORM_PARAMS => [
'query' => 'query {
Expand All @@ -72,7 +72,7 @@ protected function getUserByToken($token): array
gamerTag
}
}
}'
}',
],
]
);
Expand Down Expand Up @@ -103,7 +103,7 @@ protected function mapUserToObject(array $user): User
public function getRefreshTokenResponse($refreshToken)
{
$response = $this->getHttpClient()->post('https://api.start.gg/oauth/refresh', [
RequestOptions::HEADERS => ['Content-Type' => 'application/json'],
RequestOptions::HEADERS => ['Content-Type' => 'application/json'],
RequestOptions::FORM_PARAMS => [
'grant_type' => 'refresh_token',
'refresh_token' => $refreshToken,
Expand Down
2 changes: 1 addition & 1 deletion src/StartGg/StartGgExtendSocialite.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class StartGgExtendSocialite
/**
* Register the provider.
*
* @param \SocialiteProviders\Manager\SocialiteWasCalled $socialiteWasCalled
* @param \SocialiteProviders\Manager\SocialiteWasCalled $socialiteWasCalled
*/
public function handle(SocialiteWasCalled $socialiteWasCalled)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Steam/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public function getParams()
/**
* Parse openID response to an array.
*
* @param string $results openid response body
* @param string $results openid response body
* @return array
*/
public function parseResults($results)
Expand Down

0 comments on commit 3e3df8d

Please sign in to comment.