Skip to content

Commit 35bcdae

Browse files
committed
Use OptionsResolver in Repositories::commitComments
1 parent bfd48ac commit 35bcdae

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

UPGRADE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ Use the `deployKeys`, `deployKey`, `addDeployKey`, `deleteDeployKey`, `removeDep
6969

7070
* The `commitBuilds` method have been removed. Use `Gitlab\Api\Projects::pipelines` instead.
7171
* The `commits` method second and subsequent arguments have been replaced by a single associative array of query string parameters.
72+
* The `commitComments` method third and subsequent arguments have been replaced by a single associative array of query string parameters.
7273

7374
## `Gitlab\Model\Project` changes
7475

lib/Gitlab/Api/Repositories.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,18 +169,20 @@ public function commit($project_id, $sha)
169169
}
170170

171171
/**
172-
* @param int $project_id
172+
* @param int $project_id
173173
* @param string $sha
174-
* @param int $page
175-
* @param int $per_page
174+
* @param array $parameters
175+
*
176176
* @return mixed
177177
*/
178-
public function commitComments($project_id, $sha, $page = 0, $per_page = self::PER_PAGE)
178+
public function commitComments($project_id, $sha, array $parameters = [])
179179
{
180-
return $this->get($this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/comments'), array(
181-
'page' => $page,
182-
'per_page' => $per_page
183-
));
180+
$resolver = $this->createOptionsResolver();
181+
182+
return $this->get(
183+
$this->getProjectPath($project_id, 'repository/commits/'.$this->encodePath($sha).'/comments'),
184+
$resolver->resolve($parameters)
185+
);
184186
}
185187

186188
/**

0 commit comments

Comments
 (0)