1 | <?php |
||
17 | final class Client implements ClientInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var LoopInterface |
||
21 | */ |
||
22 | private $loop; |
||
23 | |||
24 | /** |
||
25 | * @var AsyncClientInterface |
||
26 | */ |
||
27 | private $asyncClient; |
||
28 | |||
29 | /** |
||
30 | * @param LoopInterface $loop |
||
31 | * @param AsyncClientInterface $asyncClient |
||
32 | */ |
||
33 | 10 | private function __construct(LoopInterface $loop, AsyncClientInterface $asyncClient) |
|
38 | |||
39 | /** |
||
40 | * Create a new AsyncClient based on the loop and other options pass. |
||
41 | * |
||
42 | * @param string $token Instructions to fetch the token: https://blog.travis-ci.com/2013-01-28-token-token-token/ |
||
43 | * @param array $options |
||
44 | * @return Client |
||
45 | */ |
||
46 | 1 | public static function create( |
|
58 | |||
59 | /** |
||
60 | * Create an Client from a AsyncClientInterface. |
||
61 | * Be sure to pass in a client with the options from ApiSettings and the Sync namespace suffix, |
||
62 | * and pass in the same loop as associated with the AsyncClient you're passing in. |
||
63 | * |
||
64 | * @param LoopInterface $loop |
||
65 | * @param AsyncClientInterface $asyncClient |
||
66 | * @return Client |
||
67 | */ |
||
68 | 10 | public static function createFromClient(LoopInterface $loop, AsyncClientInterface $asyncClient): self |
|
72 | |||
73 | public function hydrate(string $resource): ResourceInterface |
||
80 | |||
81 | public function extract(ResourceInterface $resource): string |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | 1 | public function repository(string $repository): RepositoryInterface |
|
99 | |||
100 | /** |
||
101 | * {@inheritdoc} |
||
102 | */ |
||
103 | 1 | public function user(): UserInterface |
|
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | 1 | public function sshKey(int $id): SSHKeyInterface |
|
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | 1 | public function hooks(): array |
|
134 | |||
135 | /** |
||
136 | * Warning this a intensive operation as it has to make a call for each hook |
||
137 | * to turn it into a Repository!!! |
||
138 | * |
||
139 | * Take a look at examples/repositories-async.php on how to limit the amount of |
||
140 | * concurrent requests. |
||
141 | * |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | 2 | public function repositories(callable $filter = null): array |
|
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | 1 | public function accounts(): array |
|
166 | |||
167 | /** |
||
168 | * {@inheritdoc} |
||
169 | */ |
||
170 | 1 | public function broadcasts(): array |
|
179 | } |
||
180 |