1
0
Fork 0
mirror of synced 2024-10-01 17:58:02 +13:00

fix scope not array error

This commit is contained in:
Bishwajeet Parhi 2022-06-09 16:54:33 +00:00
parent 086c9f431e
commit 902baa0bf4

View file

@ -12,21 +12,21 @@ class Dailymotion extends OAuth2
/** /**
* @var string * @var string
*/ */
private $endpoint = 'https://api.dailymotion.com'; private string $endpoint = 'https://api.dailymotion.com';
private $authEndpoint = 'https://www.dailymotion.com/oauth/authorize'; private string $authEndpoint = 'https://www.dailymotion.com/oauth/authorize';
/** /**
* @var array * @var array
*/ */
protected $scopes = [ protected array $scopes = [
'userinfo', 'userinfo',
'email', 'email'
]; ];
/** /**
* @var array * @var array
*/ */
protected $fields = [ protected array $fields = [
'avatar_url', 'avatar_url',
'email', 'email',
'first_name', 'first_name',
@ -40,12 +40,12 @@ class Dailymotion extends OAuth2
/** /**
* @var array * @var array
*/ */
protected $user = []; protected array $user = [];
/** /**
* @var array * @var array
*/ */
protected $tokens = []; protected array $tokens = [];
/** /**
* @return string * @return string
@ -72,15 +72,6 @@ class Dailymotion extends OAuth2
return $url; return $url;
} }
/**
*
*
* @return array
*/
protected function getFields(): array {
return $this->fields;
}
/** /**
* @param string $code * @param string $code
* *
@ -217,7 +208,7 @@ class Dailymotion extends OAuth2
$this->endpoint . '/user/me?', $this->endpoint . '/user/me?',
['Authorization: Bearer ' . \urlencode($accessToken)], ['Authorization: Bearer ' . \urlencode($accessToken)],
\http_build_query([ \http_build_query([
'fields' => \implode(',', $this->getFields())]) 'fields' => \implode(',', $fields)])
); );
$this->user = \json_decode($user, true); $this->user = \json_decode($user, true);
} }