|
1 | 1 | <?php |
2 | | -/** |
3 | | - * Pterodactyl - Panel |
4 | | - * Copyright (c) 2015 - 2017 Dane Everitt <dane@daneeveritt.com>. |
5 | | - * |
6 | | - * This software is licensed under the terms of the MIT license. |
7 | | - * https://opensource.org/licenses/MIT |
8 | | - */ |
9 | 2 |
|
10 | 3 | namespace Pterodactyl\Contracts\Repository\Daemon; |
11 | 4 |
|
| 5 | +use GuzzleHttp\Client; |
| 6 | +use Pterodactyl\Models\Node; |
| 7 | +use Pterodactyl\Models\Server; |
| 8 | + |
12 | 9 | interface BaseRepositoryInterface |
13 | 10 | { |
14 | 11 | /** |
15 | 12 | * Set the node model to be used for this daemon connection. |
16 | 13 | * |
17 | | - * @param int $id |
| 14 | + * @param \Pterodactyl\Models\Node $node |
18 | 15 | * @return $this |
19 | | - * |
20 | | - * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException |
21 | 16 | */ |
22 | | - public function setNode($id); |
| 17 | + public function setNode(Node $node); |
23 | 18 |
|
24 | 19 | /** |
25 | 20 | * Return the node model being used. |
26 | 21 | * |
27 | | - * @return \Pterodactyl\Models\Node |
| 22 | + * @return \Pterodactyl\Models\Node|null |
28 | 23 | */ |
29 | 24 | public function getNode(); |
30 | 25 |
|
31 | 26 | /** |
32 | | - * Set the UUID for the server to be used in the X-Access-Server header for daemon requests. |
| 27 | + * Set the Server model to use when requesting information from the Daemon. |
33 | 28 | * |
34 | | - * @param null|string $server |
| 29 | + * @param \Pterodactyl\Models\Server $server |
35 | 30 | * @return $this |
36 | 31 | */ |
37 | | - public function setAccessServer($server = null); |
| 32 | + public function setServer(Server $server); |
38 | 33 |
|
39 | 34 | /** |
40 | | - * Return the UUID of the server being used in requests. |
| 35 | + * Return the Server model. |
41 | 36 | * |
42 | | - * @return string |
| 37 | + * @return \Pterodactyl\Models\Server|null |
43 | 38 | */ |
44 | | - public function getAccessServer(); |
| 39 | + public function getServer(); |
45 | 40 |
|
46 | 41 | /** |
47 | 42 | * Set the token to be used in the X-Access-Token header for requests to the daemon. |
48 | 43 | * |
49 | | - * @param null|string $token |
| 44 | + * @param string $token |
50 | 45 | * @return $this |
51 | 46 | */ |
52 | | - public function setAccessToken($token = null); |
| 47 | + public function setToken(string $token); |
53 | 48 |
|
54 | 49 | /** |
55 | 50 | * Return the access token being used for requests. |
56 | 51 | * |
57 | | - * @return string |
| 52 | + * @return string|null |
58 | 53 | */ |
59 | | - public function getAccessToken(); |
| 54 | + public function getToken(); |
60 | 55 |
|
61 | 56 | /** |
62 | 57 | * Return an instance of the Guzzle HTTP Client to be used for requests. |
63 | 58 | * |
64 | 59 | * @param array $headers |
65 | 60 | * @return \GuzzleHttp\Client |
| 61 | + * |
| 62 | + * @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException |
66 | 63 | */ |
67 | | - public function getHttpClient(array $headers = []); |
| 64 | + public function getHttpClient(array $headers = []): Client; |
68 | 65 | } |
0 commit comments