Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,19 @@ public function readme($username, $repository, $format = 'raw', $dir = null, $pa
*
* @link https://developer.github.com/v3/repos/#create-a-repository-dispatch-event
*
* @param string $username the user who owns the repository
* @param string $repository the name of the repository
* @param string $eventType A custom webhook event name
* @param string $username the user who owns the repository
* @param string $repository the name of the repository
* @param string $eventType A custom webhook event name
* @param array|object $clientPayload The payload to pass to Github.
*
* @return mixed null on success, array on error with 'message'
*/
public function dispatch($username, $repository, $eventType, array $clientPayload)
public function dispatch($username, $repository, $eventType, $clientPayload)
{
if (is_array($clientPayload)) {
$clientPayload = (object) $clientPayload;
}

return $this->post(\sprintf('/repos/%s/%s/dispatches', rawurlencode($username), rawurlencode($repository)), [
'event_type' => $eventType,
'client_payload' => $clientPayload,
Expand Down