1 | <?php |
||
16 | final class Client implements ClientInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var LoopInterface |
||
20 | */ |
||
21 | private $loop; |
||
22 | |||
23 | /** |
||
24 | * @var AsyncClientInterface |
||
25 | */ |
||
26 | private $asyncClient; |
||
27 | |||
28 | /** |
||
29 | * @param LoopInterface $loop |
||
30 | * @param AsyncClientInterface $asyncClient |
||
31 | 10 | */ |
|
32 | private function __construct(LoopInterface $loop, AsyncClientInterface $asyncClient) |
||
37 | |||
38 | /** |
||
39 | * Create a new AsyncClient based on the loop and other options pass. |
||
40 | * |
||
41 | * @param string $token Instructions to fetch the token: https://blog.travis-ci.com/2013-01-28-token-token-token/ |
||
42 | * @param array $options |
||
43 | * @return Client |
||
44 | 1 | */ |
|
45 | public static function create( |
||
56 | |||
57 | /** |
||
58 | * Create an Client from a AsyncClientInterface. |
||
59 | * Be sure to pass in a client with the options from ApiSettings and the Sync namespace suffix, |
||
60 | * and pass in the same loop as associated with the AsyncClient you're passing in. |
||
61 | * |
||
62 | * @param LoopInterface $loop |
||
63 | * @param AsyncClientInterface $asyncClient |
||
64 | * @return Client |
||
65 | 10 | */ |
|
66 | public static function createFromClient(LoopInterface $loop, AsyncClientInterface $asyncClient): self |
||
70 | |||
71 | public function hydrate(string $resource): ResourceInterface |
||
78 | |||
79 | public function extract(ResourceInterface $resource): string |
||
86 | 1 | ||
87 | 1 | /** |
|
88 | 1 | * {@inheritdoc} |
|
89 | */ |
||
90 | public function repository(string $repository): RepositoryInterface |
||
97 | 1 | ||
98 | 1 | /** |
|
99 | 1 | * {@inheritdoc} |
|
100 | */ |
||
101 | public function user(): UserInterface |
||
108 | 1 | ||
109 | 1 | /** |
|
110 | 1 | * {@inheritdoc} |
|
111 | */ |
||
112 | 1 | public function sshKey(int $id): SSHKeyInterface |
|
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function hooks(): array |
||
132 | |||
133 | /** |
||
134 | * Warning this a intensive operation as it has to make a call for each hook |
||
135 | * to turn it into a Repository!!! |
||
136 | * |
||
137 | * Take a look at examples/repositories-async.php on how to limit the amount of |
||
138 | 1 | * concurrent requests. |
|
139 | * |
||
140 | 1 | * {@inheritdoc} |
|
141 | 1 | */ |
|
142 | 1 | public function repositories(callable $filter = null): array |
|
151 | 1 | ||
152 | /** |
||
153 | 1 | * {@inheritdoc} |
|
154 | 1 | */ |
|
155 | 1 | public function accounts(): array |
|
164 | |||
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | public function broadcasts(): array |
||
177 | } |
||
178 |