Last active
October 13, 2015 13:43
-
-
Save YOzaz/3f0c539562a5a17dc6e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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