for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace Stevenmaguire\OAuth2\Client\Provider;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
class HerokuResourceOwner implements ResourceOwnerInterface
{
use ArrayAccessorTrait;
/**
* Raw response
*
* @var array
*/
protected $response;
* Creates new resource owner.
* @param array $response
public function __construct(array $response = array())
$this->response = $response;
}
* Get user id
* @return string|null
public function getId()
return $this->getResponseData('id');
* Get user name
public function getName()
return $this->getResponseData('name');
* Get user email
public function getEmail()
return $this->getResponseData('email');
* Attempts to pull value from array using dot notation.
* @param string $path
* @param string $default
* @return mixed
protected function getResponseData($path, $default = null)
return $this->getValueByKey($this->response, $path, $default);
* Return all of the owner details available as an array.
* @return array
public function toArray()
return $this->response;