update
This commit is contained in:
48
modules/pshowsso/vendor/smolblog/oauth2-twitter/src/TwitterUser.php
vendored
Normal file
48
modules/pshowsso/vendor/smolblog/oauth2-twitter/src/TwitterUser.php
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace Pshowsso\Scope68f5e85e9608b\Smolblog\OAuth2\Client\Provider;
|
||||
|
||||
use Pshowsso\Scope68f5e85e9608b\League\OAuth2\Client\Provider\ResourceOwnerInterface;
|
||||
class TwitterUser implements ResourceOwnerInterface
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $response;
|
||||
/**
|
||||
* @param array $response
|
||||
*/
|
||||
public function __construct(array $response)
|
||||
{
|
||||
$this->response = $response['data'] ?? [];
|
||||
}
|
||||
public function getId()
|
||||
{
|
||||
return $this->response['id'];
|
||||
}
|
||||
public function getName()
|
||||
{
|
||||
return $this->response['name'];
|
||||
}
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->response['username'];
|
||||
}
|
||||
public function getImageUrl()
|
||||
{
|
||||
return $this->response['profile_image_url'];
|
||||
}
|
||||
/**
|
||||
* Get user data as an array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function toArray(): array
|
||||
{
|
||||
return $this->response;
|
||||
}
|
||||
private function getResponseValue($key)
|
||||
{
|
||||
return $this->response[$key] ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user