original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Function parses social service response and prepares user data to insert to database .