Repository navigation
Expand file tree
/
Copy pathCommit.php
More file actions
51 lines (44 loc) · 1.63 KB
/
Copy pathCommit.php
File metadata and controls
51 lines (44 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php declare(strict_types=1);
namespace ApiClients\Client\Github\Resource\Async\Repository;
use ApiClients\Client\Github\CommandBus\Command\RefreshCommand;
use ApiClients\Client\Github\CommandBus\Command\Repository\Commit\ChecksCommand;
use ApiClients\Client\Github\CommandBus\Command\Repository\Commit\CreateStatusCommand;
use ApiClients\Client\Github\CommandBus\Command\Repository\Commit\StatusCommand;
use ApiClients\Client\Github\CommandBus\Command\Repository\Commit\StatusesCommand;
use ApiClients\Client\Github\Resource\Repository\Commit as BaseCommit;
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
use React\Promise\PromiseInterface;
use Rx\ObservableInterface;
class Commit extends BaseCommit
{
public function refresh(): PromiseInterface
{
return $this->handleCommand(
new RefreshCommand($this)
);
}
public function status(): PromiseInterface
{
return $this->handleCommand(
new StatusCommand($this)
);
}
public function statuses(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new StatusesCommand($this)
));
}
public function checks(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new ChecksCommand($this)
));
}
public function createStatus(string $state, ?string $targetUrl = null, ?string $description = null, ?string $context = null): PromiseInterface
{
return $this->handleCommand(
new CreateStatusCommand($this, $state, $targetUrl, $description, $context)
);
}
}