wishthis/vendor/knplabs/github-api/lib/Github/Api/Organization/Projects.php

24 lines
630 B
PHP
Raw Normal View History

2022-01-21 08:23:52 +00:00
<?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);
}
}