Skip to content

Commit

Permalink
removed params validation
Browse files Browse the repository at this point in the history
  • Loading branch information
SergkeiM committed Mar 10, 2023
1 parent 9734d23 commit c72fdae
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/Github/Api/Deployment/Policies.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Github\Api\Deployment;

use Github\Api\AbstractApi;
use Github\Exception\MissingArgumentException;

/**
* Listing, creating and updating deployments.
Expand Down Expand Up @@ -55,16 +54,10 @@ public function show(string $username, string $repository, string $environment,
* @param string $repository the name of the repository
* @param string $environment the name of the environment.
*
* @throws MissingArgumentException
*
* @return array information about the deployment branch policy
*/
public function create(string $username, string $repository, string $environment, array $params)
{
if (!isset($params['name'])) {
throw new MissingArgumentException(['name']);
}

return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies', $params);
}

Expand All @@ -82,10 +75,6 @@ public function create(string $username, string $repository, string $environment
*/
public function update(string $username, string $repository, string $environment, int $id, array $params)
{
if (!isset($params['name'])) {
throw new MissingArgumentException(['name']);
}

return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/environments/'.rawurlencode($environment).'/deployment-branch-policies/'.$id, $params);
}

Expand Down

0 comments on commit c72fdae

Please sign in to comment.