Skip to content

Commit 6e843e6

Browse files
authored
Merge pull request KnpLabs#738 from acrobat/fix-issue-assignee-parameter
Convert the issue assignee parameter to array
2 parents ba69b3d + 6e9759c commit 6e843e6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/Github/Api/Issue/Assignees.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public function add($username, $repository, $issue, array $parameters)
5757
throw new MissingArgumentException('assignees');
5858
}
5959

60+
if (!is_array($parameters['assignees'])) {
61+
@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);
62+
63+
$parameters['assignees'] = [$parameters['assignees']];
64+
}
65+
6066
return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.rawurlencode($issue).'/assignees', $parameters);
6167
}
6268

0 commit comments

Comments
 (0)