app/library/OAuth/UserData/UserDataInterface.php: adding getFirstname() and getLastname()
This commit is contained in:
parent
5d60b0f238
commit
c65020fa43
5 changed files with 83 additions and 4 deletions
|
|
@ -46,6 +46,18 @@ class Github implements UserDataInterface
|
|||
return $this->data['name'];
|
||||
}
|
||||
|
||||
public function getFirstname()
|
||||
{
|
||||
$pos = strpos($this->getName(), ' ');
|
||||
return $pos !== false ? substr($this->getName(), 0, $pos) : $this->getName();
|
||||
}
|
||||
|
||||
public function getLastname()
|
||||
{
|
||||
$pos = strpos($this->getName(), ' ');
|
||||
return $pos !== false ? substr($this->getName(), $pos+1) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
|
|||
Reference in a new issue