Skip to content

Commit dc645f2

Browse files
sidneymarieannem1guelpf
authored andcommitted
add parameters when getting project labels
Couldn't get all the labels of a project due to the default limit of 20 per page. Now we can pass optional paramaters to get project labels ex: $parameters = ['page'=>1, 'per_page'=>100];
1 parent 2a55632 commit dc645f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Gitlab/Api/Projects.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,11 +493,14 @@ public function events($project_id, array $parameters = [])
493493

494494
/**
495495
* @param int $project_id
496+
* @param array $parameters
496497
* @return mixed
497498
*/
498-
public function labels($project_id)
499+
public function labels($project_id, array $parameters = [])
499500
{
500-
return $this->get($this->getProjectPath($project_id, 'labels'));
501+
$resolver = $this->createOptionsResolver();
502+
503+
return $this->get($this->getProjectPath($project_id, 'labels'), $resolver->resolve($parameters));
501504
}
502505

503506
/**

0 commit comments

Comments
 (0)