adding app/library/OAuth/UserData/Gitlab.php
This commit is contained in:
parent
4042b36422
commit
e62a93e021
1 changed files with 56 additions and 0 deletions
56
app/library/OAuth/UserData/Gitlab.php
Normal file
56
app/library/OAuth/UserData/Gitlab.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
namespace Httpcb\OAuth\UserData;
|
||||
|
||||
class Gitlab implements UserDataInterface
|
||||
{
|
||||
protected $data;
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getProvider()
|
||||
{
|
||||
return 'Gitlab';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return (int) $this->data['id'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getUsername()
|
||||
{
|
||||
return $this->data['username'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return $this->data['name'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getEmail()
|
||||
{
|
||||
return $this->data['email'];
|
||||
}
|
||||
}
|
||||
Reference in a new issue