src/Gzero/Repository/SocialRepository.php
private function parseServiceResponse(AbstractUser $response)
    {
        $userData = [
            'has_social_integrations' => true,
            'nick'                    => $response->getNickname()
        ];
        // set user email if exists (twitter returns as null)
        if ($response->getEmail()) {
            $userData['email'] = $response->getEmail();
        } else {
            $userData['email'] = uniqid('social_', true); // set unique email placeholder
        }
        // set user first and last name
        $name = explode(" ", $response->getName());
        if (count($name) >= 2) {
            $userData['first_name'] = $name[0];
            $userData['last_name']  = $name[1];
        }

        return $userData;
    }
private function parseServiceResponse(AbstractUser $response)
    {
        $userData = [
            'has_social_integrations' => true,
            'nick'                    => $response->getNickname()
        ];
        // set user email if exists (twitter returns as null)
        if ($response->getEmail()) {
            $userData['email'] = $response->getEmail();
        } else {
            $userData['email'] = uniqid('social_', true); // set unique email placeholder
        }
        // set user first and last name
        $name = explode(" ", $response->getName());
        if (count($name) >= 2) {
            $userData['first_name'] = $name[0];
            $userData['last_name']  = $name[1];
        }

        return $userData;
    }
private function parseServiceResponse ( AbstractUser $ response ) { $ userData = [ 'has_social_integrations' => true , 'nick' => $ response -> getNickname ( ) ] ; // set user email if exists (twitter returns as null) if ( $ response -> getEmail ( ) ) { $ userData [ 'email' ] = $ response -> getEmail ( ) ; } else { $ userData [ 'email' ] = uniqid ( 'social_' , true ) ; // set unique email placeholder } // set user first and last name $ name = explode ( " " , $ response -> getName ( ) ) ; if ( count ( $ name ) >= 2 ) { $ userData [ 'first_name' ] = $ name [ 0 ] ; $ userData [ 'last_name' ] = $ name [ 1 ] ; } return $ userData ; }
Function parses social service response and prepares user data to insert to database.

@param $response AbstractUser response data

@return array parsed user data for database insertion
Function parses social service response and prepares user data to insert to database .