This commit is contained in:
2025-10-20 14:10:54 +02:00
parent 75ca8fd840
commit d2c1970ef8
732 changed files with 101915 additions and 2 deletions

View 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;
}
}