Skip to content

Commit

Permalink
Fix StyleCI issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pkolmann committed Jul 5, 2024
1 parent 1b71cde commit 8b0c821
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Api/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -1033,10 +1033,11 @@ public function search($id, array $parameters = [])
}

/**
* Get a list of registry repositories in a group
* Get a list of registry repositories in a group.
* @see https://docs.gitlab.com/ee/api/container_registry.html#within-a-group
*
* @param $id: The ID of a group
*
* @return mixed
*/
public function registryRepositories(int $id)
Expand Down
1 change: 1 addition & 0 deletions src/Api/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -1838,6 +1838,7 @@ public function search($id, array $parameters = [])
*
* @param int|string $project_id
* @param array $parameters {
*
* @var bool $tags If the parameter is included as true, each repository includes an array of "tags" in the response.
* @var bool $tags_count If the parameter is included as true, each repository includes "tags_count" in the response.
* }
Expand Down
11 changes: 8 additions & 3 deletions src/Api/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
namespace Gitlab\Api;

use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;

class Registry extends AbstractApi
{
/**
* @see https://docs.gitlab.com/ee/api/container_registry.html#get-details-of-a-single-repository
*
* @param int|string $repository_id The ID of the registry repository accessible by the authenticated user.
* @param int|string $repository_id The ID of the registry repository accessible by the authenticated user
* @param array $parameters {
*
* @var bool $tags
* @var bool $tags_count
* @var bool $size
* }
*
* @return mixed
*/
public function repositories($repository_id, array $parameters = [])
Expand Down Expand Up @@ -55,6 +56,7 @@ public function repositories($repository_id, array $parameters = [])
*
* @param int|string $project_id
* @param int $repository_id
*
* @return mixed
*/
public function repositoryTags($project_id, int $repository_id)
Expand All @@ -71,6 +73,7 @@ public function repositoryTags($project_id, int $repository_id)
* @param int|string $project_id
* @param int $repository_id
* @param string $tag_name
*
* @return mixed
*/
public function repositoryTag($project_id, int $repository_id, string $tag_name)
Expand All @@ -90,6 +93,7 @@ public function repositoryTag($project_id, int $repository_id, string $tag_name)
* @param int|string $project_id
* @param int $repository_id
* @param string $tag_name
*
* @return mixed
*/
public function removeRepositoryTag($project_id, int $repository_id, string $tag_name)
Expand All @@ -108,11 +112,13 @@ public function removeRepositoryTag($project_id, int $repository_id, string $tag
* @param int|string $project_id
* @param int $repository_id
* @param array $parameters {
*
* @var string $name_regex_delete
* @var string $name_regex_keep
* @var int $keep_n
* @var string $older_than
* }
*
* @return mixed
*/
public function removeRepositoryTags($project_id, int $repository_id, array $parameters = [])
Expand All @@ -127,7 +133,6 @@ public function removeRepositoryTags($project_id, int $repository_id, array $par
$resolver->setDefined('older_than')
->setAllowedTypes('older_than', 'string');


return $this->delete(
$this->getProjectPath(
$project_id,
Expand Down
4 changes: 2 additions & 2 deletions tests/Api/ProjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3076,15 +3076,15 @@ public function shouldGetProjectRegistryRepositoriesTags(): void
{
$expectedArray = [
['id' => 1, 'name' => 'A registry', 'tags' => ['1.0', '1.1'], 'tags_count' => 2],
['id' => 2, 'name' => 'Another registry', 'tags' => ['2.0', '2.1'], 'tags_count' => 2]
['id' => 2, 'name' => 'Another registry', 'tags' => ['2.0', '2.1'], 'tags_count' => 2],
];

$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('projects/123/registry/repositories', [
'tags' => true,
'tags_count' => true
'tags_count' => true,
])
->will($this->returnValue($expectedArray));

Expand Down
5 changes: 2 additions & 3 deletions tests/Api/RegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public function shouldGetSingleRepositoryWithParams(): void
*/
public function shouldGetRepositoryTags(): void
{
$expectedArray = [['name' => "A", 'path' => 'group/project:A'], ['name' => "B", 'path' => 'group/project:B']];

$expectedArray = [['name' => 'A', 'path' => 'group/project:A'], ['name' => 'B', 'path' => 'group/project:B']];
$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
Expand All @@ -77,7 +76,7 @@ public function shouldGetRepositoryTags(): void
*/
public function shouldGetRepositoryTag(): void
{
$expectedArray = ['name' => "A", 'path' => 'group/project:A'];
$expectedArray = ['name' => 'A', 'path' => 'group/project:A'];

$api = $this->getApiMock();
$api->expects($this->once())
Expand Down

0 comments on commit 8b0c821

Please sign in to comment.