File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
<?php namespace Gitlab \Api ;
2
2
3
+ use Symfony \Component \OptionsResolver \OptionsResolver ;
4
+
3
5
class Environments extends AbstractApi
4
6
{
5
7
/**
@@ -13,12 +15,20 @@ public function all($project_id)
13
15
14
16
/**
15
17
* @param int $project_id
16
- * @param array $params
18
+ * @param array $parameters
17
19
* @return mixed
18
20
*/
19
- public function create ($ project_id , array $ params = array ())
21
+ public function create ($ project_id , array $ parameters = array ())
20
22
{
21
- return $ this ->post ($ this ->getProjectPath ($ project_id , 'environment ' ), $ params );
23
+ $ resolver = new OptionsResolver ();
24
+ $ resolver ->setDefined ('name ' )
25
+ ->setAllowedTypes ('name ' , 'string ' );
26
+ $ resolver ->setDefined ('slug ' )
27
+ ->setAllowedTypes ('slug ' , 'string ' );
28
+ $ resolver ->setDefined ('external_url ' )
29
+ ->setAllowedTypes ('external_url ' , 'string ' );
30
+
31
+ return $ this ->post ($ this ->getProjectPath ($ project_id , 'environment ' ), $ resolver ->resolve ($ parameters ));
22
32
}
23
33
24
34
/**
You can’t perform that action at this time.
0 commit comments