1
1
<?php namespace Gitlab \Model ;
2
2
3
- use Gitlab \Api \MergeRequests ;
3
+ use Gitlab \Api \Projects ;
4
+ use Gitlab \Api \Repositories ;
4
5
use Gitlab \Client ;
5
- use Gitlab \Api \AbstractApi as Api ;
6
6
7
7
/**
8
8
* Class Project
@@ -235,13 +235,15 @@ public function removeMember($user_id)
235
235
}
236
236
237
237
/**
238
- * @param int $page
239
- * @param int $per_page
238
+ * @param array $parameters
239
+ *
240
+ * @see Projects::hooks() for available parameters.
241
+ *
240
242
* @return ProjectHook[]
241
243
*/
242
- public function hooks ($ page = 1 , $ per_page = Api:: PER_PAGE )
244
+ public function hooks (array $ parameters = [] )
243
245
{
244
- $ data = $ this ->client ->projects ()->hooks ($ this ->id , $ page , $ per_page );
246
+ $ data = $ this ->client ->projects ()->hooks ($ this ->id , $ parameters );
245
247
246
248
$ hooks = array ();
247
249
foreach ($ data as $ hook ) {
@@ -449,14 +451,15 @@ public function tags()
449
451
}
450
452
451
453
/**
452
- * @param int $page
453
- * @param int $per_page
454
- * @param string $ref_name
454
+ * @param array $parameters
455
+ *
456
+ * @see Repositories::commits() for available parameters.
457
+ *
455
458
* @return Commit[]
456
459
*/
457
- public function commits ($ page = 0 , $ per_page = Api:: PER_PAGE , $ ref_name = null )
460
+ public function commits (array $ parameters = [] )
458
461
{
459
- $ data = $ this ->client ->repositories ()->commits ($ this ->id , $ page , $ per_page , $ ref_name );
462
+ $ data = $ this ->client ->repositories ()->commits ($ this ->id , $ parameters );
460
463
461
464
$ commits = array ();
462
465
foreach ($ data as $ commit ) {
@@ -479,13 +482,15 @@ public function commit($sha)
479
482
480
483
/**
481
484
* @param string $ref
482
- * @param int $page
483
- * @param int $per_page
485
+ * @param array $parameters
486
+ *
487
+ * @see Repositories::commitComments() for available parameters.
488
+ *
484
489
* @return Commit[]
485
490
*/
486
- public function commitComments ($ ref , $ page = 0 , $ per_page = Api:: PER_PAGE )
491
+ public function commitComments ($ ref , array $ parameters = [] )
487
492
{
488
- $ data = $ this ->client ->repositories ()->commitComments ($ this ->id , $ ref , $ page , $ per_page );
493
+ $ data = $ this ->client ->repositories ()->commitComments ($ this ->id , $ ref , $ parameters );
489
494
490
495
$ comments = array ();
491
496
foreach ($ data as $ comment ) {
@@ -614,13 +619,15 @@ public function deleteFile($file_path, $branch_name, $commit_message, $author_em
614
619
}
615
620
616
621
/**
617
- * @param int $page
618
- * @param int $per_page
622
+ * @param array $parameters
623
+ *
624
+ * @see Projects::events() for available parameters.
625
+ *
619
626
* @return Event[]
620
627
*/
621
- public function events ($ page = 1 , $ per_page = Api:: PER_PAGE )
628
+ public function events (array $ parameters = [] )
622
629
{
623
- $ data = $ this ->client ->projects ()->events ($ this ->id , $ page , $ per_page );
630
+ $ data = $ this ->client ->projects ()->events ($ this ->id , $ parameters );
624
631
625
632
$ events = array ();
626
633
foreach ($ data as $ event ) {
@@ -631,14 +638,15 @@ public function events($page = 1, $per_page = Api::PER_PAGE)
631
638
}
632
639
633
640
/**
634
- * @param int $page
635
- * @param int $per_page
636
- * @param string $state
641
+ * @param array $parameters
642
+ *
643
+ * @see MergeRequests::all() for available parameters.
644
+ *
637
645
* @return MergeRequest[]
638
646
*/
639
- public function mergeRequests ($ page = 1 , $ per_page = Api:: PER_PAGE , $ state = MergeRequests:: STATE_ALL )
647
+ public function mergeRequests (array $ parameters = [] )
640
648
{
641
- $ data = $ this ->client ->mergeRequests ()->$ state ($ this ->id , $ page , $ per_page );
649
+ $ data = $ this ->client ->mergeRequests ()->all ($ this ->id , $ parameters );
642
650
643
651
$ mrs = array ();
644
652
foreach ($ data as $ mr ) {
@@ -720,13 +728,15 @@ public function mergeMergeRequest($id)
720
728
}
721
729
722
730
/**
723
- * @param int $page
724
- * @param int $per_page
731
+ * @param array $parameters
732
+ *
733
+ * @see Issues::all() for available parameters.
734
+ *
725
735
* @return Issue[]
726
736
*/
727
- public function issues ($ page = 1 , $ per_page = Api:: PER_PAGE )
737
+ public function issues (array $ parameters = [] )
728
738
{
729
- $ data = $ this ->client ->issues ()->all ($ this ->id , $ page , $ per_page );
739
+ $ data = $ this ->client ->issues ()->all ($ this ->id , $ parameters );
730
740
731
741
$ issues = array ();
732
742
foreach ($ data as $ issue ) {
@@ -796,13 +806,15 @@ public function openIssue($id)
796
806
}
797
807
798
808
/**
799
- * @param int $page
800
- * @param int $per_page
809
+ * @param array $parameters
810
+ *
811
+ * @see Milestones::all() for available parameters.
812
+ *
801
813
* @return Milestone[]
802
814
*/
803
- public function milestones ($ page = 1 , $ per_page = Api:: PER_PAGE )
815
+ public function milestones (array $ parameters = [] )
804
816
{
805
- $ data = $ this ->client ->milestones ()->all ($ this ->id , $ page , $ per_page );
817
+ $ data = $ this ->client ->milestones ()->all ($ this ->id , $ parameters );
806
818
807
819
$ milestones = array ();
808
820
foreach ($ data as $ milestone ) {
0 commit comments