for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Nilesuan\OAuth2\Client\Provider;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
class HarvestResourceOwner implements ResourceOwnerInterface
{
/**
* 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->response['user']['id'] ?: null;
* Get resource owner email
public function getEmail()
return $this->response['user']['email'] ?: null;
* Get resource owner name
public function getName()
return $this->response['user']['first_name'].' '.$this->response['user']['last_name'] ?: null;
* Get resource owner avatar url
public function getAvatar()
return $this->response['user']['avatar_url'] ?: 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;