Skip to content

Commit

Permalink
Merge pull request #269 from dylangl/master
Browse files Browse the repository at this point in the history
add params id fork
  • Loading branch information
fbourigault authored Nov 15, 2017
2 parents 5eef62c + 2916023 commit 35ecf9b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/Gitlab/Api/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
use Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException;
use Symfony\Component\OptionsResolver\OptionsResolver;

class Projects extends AbstractApi
{
Expand Down Expand Up @@ -496,11 +497,20 @@ public function removeLabel($project_id, $name)

/**
* @param int $project_id
* @param array $params (
*
* @var string $namespace The ID or path of the namespace that the project will be forked to
* )
* @return mixed
*/
public function fork($project_id)
public function fork($project_id, array $parameters = [])
{
return $this->post('projects/'.$this->encodePath($project_id).'/fork');
$resolver = new OptionsResolver();
$resolver->setDefined('namespace');

$resolved = $resolver->resolve($parameters);

return $this->post($this->getProjectPath($project_id, 'fork'), $resolved);
}

/**
Expand Down

0 comments on commit 35ecf9b

Please sign in to comment.