Skip to content

Instantly share code, notes, and snippets.

@YOzaz
Last active October 13, 2015 13:43
Show Gist options
  • Select an option

  • Save YOzaz/3f0c539562a5a17dc6e5 to your computer and use it in GitHub Desktop.

Select an option

Save YOzaz/3f0c539562a5a17dc6e5 to your computer and use it in GitHub Desktop.
<?php
/* ... */
/**
* Gets currently logged-in user
*
* @param string $token
* @param array $params
* @return array
*/
public function getUser( $token, $params = [] )
{
$endpoint = '/me';
$endpoint .= !empty($params) ? '?' . http_build_query($params) : '';
$response = $this->fb->get(
$endpoint,
$token
);
return $response->getGraphUser();
}
/* ... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment