File tree 1 file changed +12
-2
lines changed
1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
use Symfony \Component \OptionsResolver \Exception \InvalidOptionsException ;
4
4
use Symfony \Component \OptionsResolver \Exception \UndefinedOptionsException ;
5
+ use Symfony \Component \OptionsResolver \OptionsResolver ;
5
6
6
7
class Projects extends AbstractApi
7
8
{
@@ -496,11 +497,20 @@ public function removeLabel($project_id, $name)
496
497
497
498
/**
498
499
* @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
+ * )
499
504
* @return mixed
500
505
*/
501
- public function fork ($ project_id )
506
+ public function fork ($ project_id, array $ parameters = [] )
502
507
{
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 );
504
514
}
505
515
506
516
/**
You can’t perform that action at this time.
0 commit comments