3
3
namespace Github \Api \Deployment ;
4
4
5
5
use Github \Api \AbstractApi ;
6
- use Github \Exception \MissingArgumentException ;
7
6
8
7
/**
9
8
* Listing, creating and updating deployments.
@@ -55,16 +54,10 @@ public function show(string $username, string $repository, string $environment,
55
54
* @param string $repository the name of the repository
56
55
* @param string $environment the name of the environment.
57
56
*
58
- * @throws MissingArgumentException
59
- *
60
57
* @return array information about the deployment branch policy
61
58
*/
62
59
public function create (string $ username , string $ repository , string $ environment , array $ params )
63
60
{
64
- if (!isset ($ params ['name ' ])) {
65
- throw new MissingArgumentException (['name ' ]);
66
- }
67
-
68
61
return $ this ->post ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/environments/ ' .rawurlencode ($ environment ).'/deployment-branch-policies ' , $ params );
69
62
}
70
63
@@ -82,10 +75,6 @@ public function create(string $username, string $repository, string $environment
82
75
*/
83
76
public function update (string $ username , string $ repository , string $ environment , int $ id , array $ params )
84
77
{
85
- if (!isset ($ params ['name ' ])) {
86
- throw new MissingArgumentException (['name ' ]);
87
- }
88
-
89
78
return $ this ->put ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/environments/ ' .rawurlencode ($ environment ).'/deployment-branch-policies/ ' .$ id , $ params );
90
79
}
91
80
0 commit comments