wishthis/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php
2022-01-21 09:23:52 +01:00

23 lines
630 B
PHP

<?php
namespace Github\Api\Organization;
use Github\Api\Project\AbstractProjectApi;
use Github\Exception\MissingArgumentException;
class Projects extends AbstractProjectApi
{
public function all($organization, array $params = [])
{
return $this->get('/orgs/'.rawurlencode($organization).'/projects', array_merge(['page' => 1], $params));
}
public function create($organization, array $params)
{
if (!isset($params['name'])) {
throw new MissingArgumentException(['name']);
}
return $this->post('/orgs/'.rawurlencode($organization).'/projects', $params);
}
}