Skip to content

Commit 5119c59

Browse files
authored
Add parameters to the list of project repository tags. (#632)
1 parent 2c4bdc2 commit 5119c59

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/Api/Tags.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,26 @@ class Tags extends AbstractApi
1818
{
1919
/**
2020
* @param int|string $project_id
21+
* @param array $parameters {
22+
*
23+
* @var string $order_by Return tags ordered by `name` or `updated` fields. Default is `updated`.
24+
* @var string $sort Return tags sorted in asc or desc order. Default is desc.
25+
* @var string $search Return list of tags matching the search criteria. You can use `^term` and `term$` to
26+
* find tags that begin and end with term respectively.
27+
* }
2128
*
2229
* @return mixed
2330
*/
24-
public function all($project_id)
31+
public function all($project_id, array $parameters = [])
2532
{
26-
return $this->get($this->getProjectPath($project_id, 'repository/tags'));
33+
$resolver = $this->createOptionsResolver();
34+
$resolver->setDefined('order_by')
35+
->setAllowedValues('order_by', ['name', 'updated']);
36+
$resolver->setDefined('sort')
37+
->setAllowedValues('sort', ['asc', 'desc']);
38+
$resolver->setDefined('search');
39+
40+
return $this->get($this->getProjectPath($project_id, 'repository/tags'), $resolver->resolve($parameters));
2741
}
2842

2943
/**

0 commit comments

Comments
 (0)