mirror of
https://github.com/avency/Gitea.git
synced 2025-10-29 18:52:33 +01:00
feat: Add issues endpoint
This commit is contained in:
52
Classes/Endpoint/Issues/StopwatchTrait.php
Normal file
52
Classes/Endpoint/Issues/StopwatchTrait.php
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user