feat: Add issues endpoint

This commit is contained in:
Michael Gerdemann
2020-01-20 07:59:23 +01:00
parent 53c5c232d2
commit dcc8a2aac8
12 changed files with 949 additions and 42 deletions

View File

@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
namespace Avency\Gitea\Endpoint\Issues;
use Avency\Gitea\Client;
/**
* Issues Stopwatch Trait
*/
trait StopwatchTrait
{
/**
* @param string $owner
* @param string $repositoryName
* @param int $index
* @return bool
*/
public function startStopwatch(string $owner, string $repositoryName, int $index): bool
{
$this->client->request(self::BASE_URI . '/' . $owner . '/' . $repositoryName . '/issues/' . $index . '/stopwatch/start', 'POST');
return true;
}
/**
* @param string $owner
* @param string $repositoryName
* @param int $index
* @return bool
*/
public function stopStopwatch(string $owner, string $repositoryName, int $index): bool
{
$this->client->request(self::BASE_URI . '/' . $owner . '/' . $repositoryName . '/issues/' . $index . '/stopwatch/stop', 'POST');
return true;
}
/**
* @param string $owner
* @param string $repositoryName
* @param int $index
* @return bool
*/
public function deleteStopwatch(string $owner, string $repositoryName, int $index): bool
{
$this->client->request(self::BASE_URI . '/' . $owner . '/' . $repositoryName . '/issues/' . $index . '/stopwatch/delete', 'DELETE');
return true;
}
}