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;
class MicrosoftResourceOwner implements ResourceOwnerInterface
{
/**
* 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->response['id'] ?: null;
* Get user email
public function getEmail()
return $this->response['emails']['preferred'] ?: null;
* Get user firstname
public function getFirstname()
return $this->response['first_name'] ?: null;
* Get user lastname
public function getLastname()
return $this->response['last_name'] ?: null;
* Get user name
public function getName()
return $this->response['name'] ?: null;
* Get user urls
public function getUrls()
return isset($this->response['link']) ? $this->response['link'].'/cid-'.$this->getId() : null;
* Return all of the owner details available as an array.
* @return array
public function toArray()
return $this->response;