From 2b23c797949c6541483fccc0d8735bc390ad35d5 Mon Sep 17 00:00:00 2001 From: miscbits Date: Tue, 14 Nov 2017 21:56:09 -0500 Subject: [PATCH 1/5] added request params and headers to user followers calls --- lib/Github/Api/User.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/Github/Api/User.php b/lib/Github/Api/User.php index d4dc6bccbf6..2caf2c0d4d6 100644 --- a/lib/Github/Api/User.php +++ b/lib/Github/Api/User.php @@ -88,12 +88,14 @@ public function orgs() * @link http://developer.github.com/v3/users/followers/ * * @param string $username the username + * @param array $parameters parameters for the query string + * @param array $requestHeaders additional headers to set in the request * * @return array list of followed users */ - public function following($username) + public function following($username, array $parameters = array(), array $requestHeaders = array()) { - return $this->get('/users/'.rawurlencode($username).'/following'); + return $this->get('/users/'.rawurlencode($username).'/following', $parameters, $requestHeaders); } /** @@ -102,12 +104,14 @@ public function following($username) * @link http://developer.github.com/v3/users/followers/ * * @param string $username the username + * @param array $parameters parameters for the query string + * @param array $requestHeaders additional headers to set in the request * * @return array list of following users */ - public function followers($username) + public function followers($username, array $parameters = array(), array $requestHeaders = array()) { - return $this->get('/users/'.rawurlencode($username).'/followers'); + return $this->get('/users/'.rawurlencode($username).'/followers', $parameters, $requestHeaders); } /** From 1d210262c000a797240a7338ab938276afcaa8b3 Mon Sep 17 00:00:00 2001 From: Wilhem Arthur Date: Mon, 27 Nov 2017 09:28:01 -0500 Subject: [PATCH 2/5] used shorthand array syntax --- lib/Github/Api/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Github/Api/User.php b/lib/Github/Api/User.php index 2caf2c0d4d6..294abec25af 100644 --- a/lib/Github/Api/User.php +++ b/lib/Github/Api/User.php @@ -93,7 +93,7 @@ public function orgs() * * @return array list of followed users */ - public function following($username, array $parameters = array(), array $requestHeaders = array()) + public function following($username, array $parameters = [], array $requestHeaders = []) { return $this->get('/users/'.rawurlencode($username).'/following', $parameters, $requestHeaders); } From a3416c61e962073c75c3023c2b70d000115a5a25 Mon Sep 17 00:00:00 2001 From: Wilhem Arthur Date: Mon, 27 Nov 2017 15:36:47 -0500 Subject: [PATCH 3/5] modified abstract api get method to use shorthand array syntax --- lib/Github/Api/AbstractApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Github/Api/AbstractApi.php b/lib/Github/Api/AbstractApi.php index 6feff8ea2bb..d28edf98c6b 100644 --- a/lib/Github/Api/AbstractApi.php +++ b/lib/Github/Api/AbstractApi.php @@ -65,7 +65,7 @@ public function setPerPage($perPage) * * @return array|string */ - protected function get($path, array $parameters = array(), array $requestHeaders = array()) + protected function get($path, array $parameters = [], array $requestHeaders = []) { if (null !== $this->perPage && !isset($parameters['per_page'])) { $parameters['per_page'] = $this->perPage; From 8761f5b5040478b2b021a3813ff7320d31d53024 Mon Sep 17 00:00:00 2001 From: Wilhem Arthur Date: Mon, 27 Nov 2017 16:06:06 -0500 Subject: [PATCH 4/5] Revert "modified abstract api get method to use shorthand array syntax" This reverts commit a3416c61e962073c75c3023c2b70d000115a5a25. --- lib/Github/Api/AbstractApi.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Github/Api/AbstractApi.php b/lib/Github/Api/AbstractApi.php index d28edf98c6b..6feff8ea2bb 100644 --- a/lib/Github/Api/AbstractApi.php +++ b/lib/Github/Api/AbstractApi.php @@ -65,7 +65,7 @@ public function setPerPage($perPage) * * @return array|string */ - protected function get($path, array $parameters = [], array $requestHeaders = []) + protected function get($path, array $parameters = array(), array $requestHeaders = array()) { if (null !== $this->perPage && !isset($parameters['per_page'])) { $parameters['per_page'] = $this->perPage; From 7d838609ac6d373dc74015bd782ace6f320cb181 Mon Sep 17 00:00:00 2001 From: Wilhem Arthur Date: Mon, 27 Nov 2017 16:06:44 -0500 Subject: [PATCH 5/5] shorthand syntax for array --- lib/Github/Api/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Github/Api/User.php b/lib/Github/Api/User.php index 294abec25af..856e86c17fa 100644 --- a/lib/Github/Api/User.php +++ b/lib/Github/Api/User.php @@ -109,7 +109,7 @@ public function following($username, array $parameters = [], array $requestHeade * * @return array list of following users */ - public function followers($username, array $parameters = array(), array $requestHeaders = array()) + public function followers($username, array $parameters = [], array $requestHeaders = []) { return $this->get('/users/'.rawurlencode($username).'/followers', $parameters, $requestHeaders); }