Skip to content

Commit 35ecf9b

Browse files
authored
Merge pull request #269 from dylangl/master
add params id fork
2 parents 5eef62c + 2916023 commit 35ecf9b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/Gitlab/Api/Projects.php

+12-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
44
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
5+
use Symfony\Component\OptionsResolver\OptionsResolver;
56

67
class Projects extends AbstractApi
78
{
@@ -496,11 +497,20 @@ public function removeLabel($project_id, $name)
496497

497498
/**
498499
* @param int $project_id
500+
* @param array $params (
501+
*
502+
* @var string $namespace The ID or path of the namespace that the project will be forked to
503+
* )
499504
* @return mixed
500505
*/
501-
public function fork($project_id)
506+
public function fork($project_id, array $parameters = [])
502507
{
503-
return $this->post('projects/'.$this->encodePath($project_id).'/fork');
508+
$resolver = new OptionsResolver();
509+
$resolver->setDefined('namespace');
510+
511+
$resolved = $resolver->resolve($parameters);
512+
513+
return $this->post($this->getProjectPath($project_id, 'fork'), $resolved);
504514
}
505515

506516
/**

0 commit comments

Comments
 (0)