data = $data; } /** * {@inheritDoc} */ public function getProvider() { return 'Github'; } /** * {@inheritDoc} */ public function getId() { return (int) $this->data['id']; } /** * {@inheritDoc} */ public function getUsername() { return $this->data['login']; } /** * {@inheritDoc} */ public function getName() { 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} */ public function getEmail() { return $this->data['email']; } }