From 6e9759c978d24550887f5593b6f1b27a3099f644 Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Wed, 5 Sep 2018 20:13:29 +0200 Subject: [PATCH] Convert the assignee parameter to array --- lib/Github/Api/Issue/Assignees.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Github/Api/Issue/Assignees.php b/lib/Github/Api/Issue/Assignees.php index 31d6ac9d999..1e5e0b727a1 100644 --- a/lib/Github/Api/Issue/Assignees.php +++ b/lib/Github/Api/Issue/Assignees.php @@ -57,6 +57,12 @@ public function add($username, $repository, $issue, array $parameters) throw new MissingArgumentException('assignees'); } + if (!is_array($parameters['assignees'])) { + @trigger_error(sprintf('Passing the "assignees" parameter as a string in "%s" is deprecated and will throw an exception in php-github-api version 3.0. Pass an array of strings instead', __METHOD__), E_USER_DEPRECATED); + + $parameters['assignees'] = [$parameters['assignees']]; + } + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/assignees', $parameters); }