56 lines
817 B
PHP
56 lines
817 B
PHP
<?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'];
|
|
}
|
|
}
|