Skip to content

Instantly share code, notes, and snippets.

@nguyenphuocnhatthanh
Created March 23, 2017 04:33
Show Gist options
  • Save nguyenphuocnhatthanh/c567db79a905ca622abb93010d06a78a to your computer and use it in GitHub Desktop.
Save nguyenphuocnhatthanh/c567db79a905ca622abb93010d06a78a to your computer and use it in GitHub Desktop.
Abstract class Social
<?php
namespace App\Services\Social;
abstract class AbstractSocial
{
/**
* Return user data
*
* @param $token
* @return array
*/
public function getData($token)
{
return $this->mapUserToObject($this->getUserByToken($token));
}
/**
* Get user data from Social
*
* @param $token
* @return array
*/
abstract protected function getUserByToken($token);
/**
* Convert data
*
* @param array $user
* @return array
*/
abstract protected function mapUserToObject(array $user);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment