for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\OAuth2\Client\Provider;
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
class GithubResourceOwner implements ResourceOwnerInterface
{
use ArrayAccessorTrait;
/**
* Domain
*
* @var string
*/
protected $domain;
* Raw response
* @var array
protected $response;
* Creates new resource owner.
* @param array $response
public function __construct(array $response = array())
$this->response = $response;
}
* Get resource owner id
* @return string|null
public function getId()
return $this->getValueByKey($this->response, 'id');
* Get resource owner email
public function getEmail()
return $this->getValueByKey($this->response, 'email');
* Get resource owner name
public function getName()
return $this->getValueByKey($this->response, 'name');
* Get resource owner nickname
public function getNickname()
return $this->getValueByKey($this->response, 'login');
* Get resource owner url
public function getUrl()
$urlParts = array_filter([$this->domain, $this->getNickname()]);
return count($urlParts) ? implode('/', $urlParts) : null;
* Set resource owner domain
* @param string $domain
* @return ResourceOwner
public function setDomain($domain)
$this->domain = $domain;
return $this;
* Return all of the owner details available as an array.
* @return array
public function toArray()
return $this->response;