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 WecounselResourceOwner 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 resource owner id
* @return string|null
public function getId()
return $this->getValueByKey($this->response, 'data.id');
* Get resource owner name
* @return string
public function getName()
return implode(' ', array_filter([
$this->getValueByKey($this->response, 'data.attributes.first_name'),
$this->getValueByKey($this->response, 'data.attributes.last_name')
]));
* Get resource owner email
public function getEmail()
return $this->getValueByKey($this->response, 'data.attributes.email');
* Return all of the owner details available as an array.
* @return array
public function toArray()
return $this->response;