Devin Smith 41e8600690 more deployment changes
partial #3787
added support for deployment to any repo path.
added tagging system
2014-11-18 16:08:23 -08:00

63 lines
1.7 KiB
PHP
Executable File

<?php
namespace Github\Api\Repository;
use Github\Api\AbstractApi;
use Github\Exception\MissingArgumentException;
/**
* @link http://developer.github.com/v3/repos/statuses/
* @author Joseph Bielawski <stloyd@gmail.com>
*/
class Statuses extends AbstractApi
{
/**
* @link http://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-sha
*
* @param string $username
* @param string $repository
* @param string $sha
*
* @return array
*/
public function show($username, $repository, $sha)
{
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/statuses');
}
/**
* @link https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
*
* @param string $username
* @param string $repository
* @param string $sha
*
* @return array
*/
public function combined($username, $repository, $sha)
{
return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($sha).'/status');
}
/**
* @link http://developer.github.com/v3/repos/statuses/#create-a-status
*
* @param string $username
* @param string $repository
* @param string $sha
* @param array $params
*
* @return array
*
* @throws MissingArgumentException
*/
public function create($username, $repository, $sha, array $params = array())
{
if (!isset($params['state'])) {
throw new MissingArgumentException('state');
}
return $this->post('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/statuses/'.rawurlencode($sha), $params);
}
}