Skip to content

Commit

Permalink
feature #1066 Fix typehint for repository dispatch method (cweagans)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.4.x-dev branch.

Discussion
----------

Closes #1065

Commits
-------

714798c Fix typehint for repository dispatch method
5005773 styleci fixes
  • Loading branch information
cweagans authored Aug 1, 2022
1 parent aed0167 commit e15ee94
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/Github/Api/Repo.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,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

0 comments on commit e15ee94

Please sign in to comment.