public function normalizeGithub($return, $token)
    {
        $data = [
            'id'                => $return['id'],
            'username'          => $return['login'],
            'name'              => $return['name'],
            'email'             => $return['email'],
            'gravatar'          => $return['gravatar_id'],
            'avatar'            => $return['avatar_url'],
            'gitHubProfileLink' => $return['html_url'],
            'firstName'         => false,
            'lastName'          => false,
            'gender'            => false,
            'verified'          => true,
            'locale'            => false,
            'timezone'          => false,
            'isSilhouette'      => true,
            'emailVerified'     => false
        ];

        /**
         * Setup http://developer.github.com/v3/media/
         *
         * @todo application/vnd.github.v3
         */
        $data['email'] = $return['id'].'@github';

        $headers = ['Authorization: bearer '.$token];
        $response = $this->httpRequest('https://api.github.com', '/user/emails', null, $headers);


        if ($response->isOk()) {
            $emails = json_decode($response->getContent(), true);
            $lastEmail = end($emails);
            $data['email'] = $lastEmail['email'];
        }

        return $data;
    }
public function normalizeGithub($return, $token)
    {
        $data = [
            'id'                => $return['id'],
            'username'          => $return['login'],
            'name'              => $return['name'],
            'email'             => $return['email'],
            'gravatar'          => $return['gravatar_id'],
            'avatar'            => $return['avatar_url'],
            'gitHubProfileLink' => $return['html_url'],
            'firstName'         => false,
            'lastName'          => false,
            'gender'            => false,
            'verified'          => true,
            'locale'            => false,
            'timezone'          => false,
            'isSilhouette'      => true,
            'emailVerified'     => false
        ];

        /**
         * Setup http://developer.github.com/v3/media/
         *
         * @todo application/vnd.github.v3
         */
        $data['email'] = $return['id'].'@github';

        $headers = ['Authorization: bearer '.$token];
        $response = $this->httpRequest('https://api.github.com', '/user/emails', null, $headers);


        if ($response->isOk()) {
            $emails = json_decode($response->getContent(), true);
            $lastEmail = end($emails);
            $data['email'] = $lastEmail['email'];
        }

        return $data;
    }
public function normalizeGithub ( $ return , $ token ) { $ data = [ 'id' => $ return [ 'id' ] , 'username' => $ return [ 'login' ] , 'name' => $ return [ 'name' ] , 'email' => $ return [ 'email' ] , 'gravatar' => $ return [ 'gravatar_id' ] , 'avatar' => $ return [ 'avatar_url' ] , 'gitHubProfileLink' => $ return [ 'html_url' ] , 'firstName' => false , 'lastName' => false , 'gender' => false , 'verified' => true , 'locale' => false , 'timezone' => false , 'isSilhouette' => true , 'emailVerified' => false ] ; /**
         * Setup http://developer.github.com/v3/media/
         *
         * @todo application/vnd.github.v3
         */ $ data [ 'email' ] = $ return [ 'id' ] . '@github' ; $ headers = [ 'Authorization: bearer ' . $ token ] ; $ response = $ this -> httpRequest ( 'https://api.github.com' , '/user/emails' , null , $ headers ) ; if ( $ response -> isOk ( ) ) { $ emails = json_decode ( $ response -> getContent ( ) , true ) ; $ lastEmail = end ( $ emails ) ; $ data [ 'email' ] = $ lastEmail [ 'email' ] ; } return $ data ; }
Mapping data from github

@todo replace Buzz with Guzzle

@param Reponse $response

@return array contains normalized user data
Mapping data from github