Total Complexity | 5 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class Server implements ClientInterface |
||
14 | { |
||
15 | public static $uri = 'servers'; |
||
16 | |||
17 | public static function all(): array |
||
18 | { |
||
19 | return HetznerCloud::get(static::$uri)['servers']; |
||
|
|||
20 | } |
||
21 | |||
22 | public static function find($identifier): array |
||
23 | { |
||
24 | return HetznerCloud::get(static::$uri.'/'.$identifier)['server']; |
||
25 | } |
||
26 | |||
27 | public static function create(array $data): array |
||
28 | { |
||
29 | return HetznerCloud::post(static::$uri, $data)['server']; |
||
30 | } |
||
31 | |||
32 | public static function update($identifier, array $data): void |
||
33 | { |
||
34 | HetznerCloud::put(static::$uri.'/'.$identifier, $data); |
||
35 | } |
||
36 | |||
37 | public static function delete($identifier): ?bool |
||
40 | } |
||
41 | } |