From b1c44b2c03a358da6fca5c61303716a160df9c21 Mon Sep 17 00:00:00 2001 From: Victor Bocharsky Date: Wed, 27 Apr 2016 09:16:52 +0300 Subject: [PATCH] Add ability to get user by ID Based on http://stackoverflow.com/questions/11976393/get-github-username-by-id --- lib/Github/Api/User.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Github/Api/User.php b/lib/Github/Api/User.php index 888eb9dfed4..3ca78ec8d23 100644 --- a/lib/Github/Api/User.php +++ b/lib/Github/Api/User.php @@ -43,6 +43,18 @@ public function all($id = null) return $this->get('users?since=' . rawurldecode($id)); } + /** + * [UNDOCUMENTED] Get extended information about a user by its ID. + * + * @param int $id the user ID to get + * + * @return array informations about the user + */ + public function get($id) + { + return $this->get('user/'.rawurlencode($id)); + } + /** * Get extended information about a user by its username. *