Skip to content

Commit 2e58baa

Browse files
authored
feature KnpLabs#1020 Branch lists . ( ? query per_page) (pitonic)
This PR was squashed before being merged into the 3.4.x-dev branch. Discussion ---------- For function "branches" added: parameters for the query string. example to use: ``` return $this->client->api('repo')->branches($this->id, $repo, null , [ 'page' =>2, 'per_page' => 100 ]); ``` Commits ------- ab3d87b added: parameters for the query string 44c3923 fixed formating
1 parent c593113 commit 2e58baa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Github/Api/Repo.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,17 +503,18 @@ public function statuses()
503503
* @param string $username the username
504504
* @param string $repository the name of the repository
505505
* @param string $branch the name of the branch
506+
* @param array $parameters parameters for the query string
506507
*
507508
* @return array list of the repository branches
508509
*/
509-
public function branches($username, $repository, $branch = null)
510+
public function branches($username, $repository, $branch = null, array $parameters = [])
510511
{
511512
$url = '/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/branches';
512513
if (null !== $branch) {
513514
$url .= '/'.rawurlencode($branch);
514515
}
515516

516-
return $this->get($url);
517+
return $this->get($url, $parameters);
517518
}
518519

519520
/**

0 commit comments

Comments
 (0)