30 lines
618 B
PHP
30 lines
618 B
PHP
<?php
|
|
|
|
namespace Da\User\AuthClient;
|
|
|
|
use Da\User\Contracts\AuthClientInterface;
|
|
use yii\authclient\clients\GitHub as BaseGitHub;
|
|
|
|
class GitHub extends BaseGitHub implements AuthClientInterface
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getEmail()
|
|
{
|
|
return isset($this->getUserAttributes()['email'])
|
|
? $this->getUserAttributes()['email']
|
|
: null;
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function getUsername()
|
|
{
|
|
return isset($this->getUserAttributes()['login'])
|
|
? $this->getUserAttributes()['login']
|
|
: null;
|
|
}
|
|
}
|