File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
lib/Bitbucket/API/Repositories Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ require_once __DIR__ .'/../../vendor/autoload.php ' ;
4+
5+ $ pullRequests = new Bitbucket \API \Repositories \PullRequests ;
6+
7+ // Your Bitbucket credentials
8+ $ bb_user = 'username ' ;
9+ $ bb_pass = 'password ' ;
10+
11+ /**
12+ * $accountname The team or individual account owning the repository.
13+ * repo_slub The repository identifier.
14+ */
15+ $ accountname = 'company ' ;
16+ $ repo_slug = 'sandbox ' ;
17+
18+ // login
19+ $ pullRequests ->setCredentials ( new Bitbucket \API \Authentication \Basic ($ bb_user , $ bb_pass ) );
20+
21+ # get list of pull requests
22+ print_r ($ pullRequests ->all ($ accountname , $ repo_slug ));
Original file line number Diff line number Diff line change @@ -33,4 +33,21 @@ public function comments()
3333 {
3434 return $ this ->childFactory ('Repositories \\PullRequests \\Comments ' );
3535 }
36+
37+ /**
38+ * Get a list of pull requests
39+ *
40+ * @access public
41+ * @param string $account The team or individual account owning the repository.
42+ * @param string $repo The repository identifier.
43+ * @return mixed
44+ */
45+ public function all ($ account , $ repo )
46+ {
47+ $ this ->httpClient ->setApiVersion ('2.0 ' );
48+
49+ return $ this ->requestGet (
50+ sprintf ('repositories/%s/%s/pullrequests ' , $ account , $ repo )
51+ );
52+ }
3653}
You can’t perform that action at this time.
0 commit comments