Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Api/MergeRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class MergeRequests extends AbstractApi
* @var string $labels return merge requests matching a comma separated list of labels
* @var \DateTimeInterface $created_after return merge requests created after the given time (inclusive)
* @var \DateTimeInterface $created_before return merge requests created before the given time (inclusive)
* @var int $reviewer_id return merge requests which have the user as a reviewer with the given user id
* @var bool $wip return only draft merge requests (true) or only non-draft merge requests (false)
* }
*
* @throws UndefinedOptionsException if an option name is undefined
Expand Down Expand Up @@ -136,6 +138,13 @@ public function all($project_id = null, array $parameters = [])
return \count($value) === \count(\array_filter($value, 'is_int'));
})
;
$resolver->setDefined('reviewer_id')
->setAllowedTypes('reviewer_id', 'integer');
$resolver->setDefined('wip')
->setAllowedTypes('wip', 'boolean')
->addNormalizer('wip', static function ($resolver, $wip) {
return $wip ? 'yes' : 'no';
});

$path = null === $project_id ? 'merge_requests' : $this->getProjectPath($project_id, 'merge_requests');

Expand Down