for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Mrjoops\OAuth2\Client\Provider;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Tool\ArrayAccessorTrait;
class JiraResourceOwner implements ResourceOwnerInterface
{
use ArrayAccessorTrait;
/**
* Raw response
*
* @var array
*/
protected $response;
* Creates new resource owner.
* @param array $response
public function __construct(array $response = [])
$this->response = $response;
}
* Get resource owner avatar url
* @return string|null
public function getAvatarUrl()
return $this->getValueByKey($this->response, '0.avatarUrl');
* Get resource owner id
public function getId()
return $this->getValueByKey($this->response, '0.id');
* Get resource owner name
public function getName()
return $this->getValueByKey($this->response, '0.name');
* Get resource owner scopes
* @return array|null
public function getScopes()
return $this->getValueByKey($this->response, '0.scopes');
* Get resource owner url
public function getUrl()
return ($cloudId = $this->getId()) ? 'https://api.atlassian.com/ex/jira/'.$cloudId.'/' : null;
* Return all of the owner details available as an array.
* @return array
public function toArray()
return current($this->response);