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 11<?php namespace Gitlab \Api ;
22
3+ use Symfony \Component \OptionsResolver \OptionsResolver ;
4+
35class Environments extends AbstractApi
46{
57 /**
@@ -13,12 +15,20 @@ public function all($project_id)
1315
1416 /**
1517 * @param int $project_id
16- * @param array $params
18+ * @param array $parameters
1719 * @return mixed
1820 */
19- public function create ($ project_id , array $ params = array ())
21+ public function create ($ project_id , array $ parameters = array ())
2022 {
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 ));
2232 }
2333
2434 /**
You can’t perform that action at this time.
0 commit comments