Skip to content

Commit 728b972

Browse files
Updated to latest labels API
1 parent 2d83de4 commit 728b972

File tree

3 files changed

+14
-15
lines changed

3 files changed

+14
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
* Removed models API
1111
* Dropped support for PHP 7.1
12+
* Updated to latest labels API
1213

13-
[11.0.0-RC1]: https://github.com/GitLabPHP/Client/compare/10.3.0...11.0.0-RC1
14+
[11.0.0-RC1]: https://github.com/GitLabPHP/Client/compare/10.4.0...11.0.0-RC1
1415

1516
## [10.4.0] - UPCOMING
1617

src/Api/Groups.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,26 +312,25 @@ public function addLabel($group_id, array $params)
312312

313313
/**
314314
* @param int|string $group_id
315+
* @param int $label_id
315316
* @param array $params
316317
*
317318
* @return mixed
318319
*/
319-
public function updateLabel($group_id, array $params)
320+
public function updateLabel($group_id, int $label_id, array $params)
320321
{
321-
return $this->put('groups/'.self::encodePath($group_id).'/labels', $params);
322+
return $this->put('groups/'.self::encodePath($group_id).'/labels/'.self::encodePath($label_id), $params);
322323
}
323324

324325
/**
325326
* @param int|string $group_id
326-
* @param string $name
327+
* @param int $label_id
327328
*
328329
* @return mixed
329330
*/
330-
public function removeLabel($group_id, string $name)
331+
public function removeLabel($group_id', int $label_id)
331332
{
332-
return $this->delete('groups/'.self::encodePath($group_id).'/labels', [
333-
'name' => $name,
334-
]);
333+
return $this->delete('groups/'.self::encodePath($group_id).'/labels/'.self::encodePath($label_id));
335334
}
336335

337336
/**

src/Api/Projects.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -711,26 +711,25 @@ public function addLabel($project_id, array $parameters)
711711

712712
/**
713713
* @param int|string $project_id
714+
* @param int $label_id
714715
* @param array $parameters
715716
*
716717
* @return mixed
717718
*/
718-
public function updateLabel($project_id, array $parameters)
719+
public function updateLabel($project_id, int $label_id, array $parameters)
719720
{
720-
return $this->put($this->getProjectPath($project_id, 'labels'), $parameters);
721+
return $this->put($this->getProjectPath($project_id, 'labels/'.self::encodePath($label_id)), $parameters);
721722
}
722723

723724
/**
724725
* @param int|string $project_id
725-
* @param string $name
726+
* @param int $label_id
726727
*
727728
* @return mixed
728729
*/
729-
public function removeLabel($project_id, string $name)
730+
public function removeLabel($project_id, int $label_id)
730731
{
731-
return $this->delete($this->getProjectPath($project_id, 'labels'), [
732-
'name' => $name,
733-
]);
732+
return $this->delete($this->getProjectPath($project_id, 'labels/'.self::encodePath($label_id)));
734733
}
735734

736735
/**

0 commit comments

Comments
 (0)