-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUser.php
More file actions
51 lines (44 loc) · 1.54 KB
/
Copy pathUser.php
File metadata and controls
51 lines (44 loc) · 1.54 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;
use ApiClients\Client\Github\CommandBus\Command\RefreshCommand;
use ApiClients\Client\Github\CommandBus\Command\User\EventsCommand;
use ApiClients\Client\Github\CommandBus\Command\User\OrganizationsCommand;
use ApiClients\Client\Github\CommandBus\Command\User\RepositoriesCommand;
use ApiClients\Client\Github\CommandBus\Command\User\RepositoryCommand;
use ApiClients\Client\Github\Resource\User as BaseUser;
use function ApiClients\Tools\Rx\unwrapObservableFromPromise;
use React\Promise\PromiseInterface;
use Rx\ObservableInterface;
class User extends BaseUser
{
public function refresh(): PromiseInterface
{
return $this->handleCommand(
new RefreshCommand($this)
);
}
public function repository(string $repository): PromiseInterface
{
return $this->handleCommand(
new RepositoryCommand($this->login(), $repository)
);
}
public function repositories(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new RepositoriesCommand($this->login())
));
}
public function organizations(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new OrganizationsCommand($this->login())
));
}
public function events(): ObservableInterface
{
return unwrapObservableFromPromise($this->handleCommand(
new EventsCommand($this->login())
));
}
}