1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

fix PSR issues in Auth library #1937

This commit is contained in:
Papu Kumar 2021-10-06 00:53:04 +05:30
parent 1eba87af2c
commit 6122578fe5
4 changed files with 15 additions and 15 deletions

View file

@ -241,14 +241,14 @@ class Auth
/**
* Is Previligged User?
*
*
* @param array $roles
*
*
* @return bool
*/
public static function isPrivilegedUser(array $roles): bool
{
if(
if (
array_key_exists('role:'.self::USER_ROLE_OWNER, $roles) ||
array_key_exists('role:'.self::USER_ROLE_DEVELOPER, $roles) ||
array_key_exists('role:'.self::USER_ROLE_ADMIN, $roles)
@ -261,14 +261,14 @@ class Auth
/**
* Is App User?
*
*
* @param array $roles
*
*
* @return bool
*/
public static function isAppUser(array $roles): bool
{
if(array_key_exists('role:'.self::USER_ROLE_APP, $roles)) {
if (array_key_exists('role:'.self::USER_ROLE_APP, $roles)) {
return true;
}
@ -277,9 +277,9 @@ class Auth
/**
* Returns all roles for a user.
*
* @param Document $user
* @return array
*
* @param Document $user
* @return array
*/
public static function getRoles(Document $user): array
{

View file

@ -28,7 +28,7 @@ class Box extends OAuth2
* @var array
*/
protected $scopes = [
'manage_app_users',
'manage_app_users',
];
/**
@ -45,10 +45,10 @@ class Box extends OAuth2
public function getLoginURL(): string
{
$url = $this->endpoint . 'authorize?'.
\http_build_query([
\http_build_query([
'response_type' => 'code',
'client_id' => $this->appID,
'scope' => \implode(',', $this->getScopes()),
'scope' => \implode(',', $this->getScopes()),
'redirect_uri' => $this->callback,
'state' => \json_encode($this->state),
]);
@ -156,4 +156,4 @@ class Box extends OAuth2
return $this->user;
}
}
}

View file

@ -4,7 +4,6 @@ namespace Appwrite\Auth\OAuth2;
use Appwrite\Auth\OAuth2\Paypal;
class PaypalSandbox extends Paypal
{
protected $environment = 'sandbox';

View file

@ -139,7 +139,8 @@ class Twitch extends OAuth2
if (empty($this->user)) {
$response = \json_decode($this->request(
'GET',
$this->resourceEndpoint , [
$this->resourceEndpoint,
[
'Authorization: Bearer '.\urlencode($accessToken),
'Client-Id: '. \urlencode($this->appID)
]