Total Complexity | 5 |
Total Lines | 57 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
13 | abstract class Action implements ActionInterface |
||
14 | { |
||
15 | /** |
||
16 | * Endpoint for the action |
||
17 | * |
||
18 | * @const ENDPOINT |
||
19 | */ |
||
20 | const ENDPOINT = 'https://api.digitalocean.com/v2/droplets/[:id:]/actions'; |
||
21 | |||
22 | /** |
||
23 | * HTTP Method |
||
24 | * |
||
25 | * @const METHOD |
||
26 | */ |
||
27 | const METHOD = 'POST'; |
||
28 | |||
29 | /** |
||
30 | * ID of the droplet to perform the action on |
||
31 | * |
||
32 | * @var mixed $id |
||
33 | */ |
||
34 | protected $id; |
||
35 | |||
36 | /** |
||
37 | * Set the droplet id |
||
38 | * |
||
39 | * @param mixed $id |
||
40 | */ |
||
41 | 22 | public function setId($id) |
|
42 | { |
||
43 | 22 | $this->id = $id; |
|
44 | 22 | } |
|
45 | |||
46 | /** |
||
47 | * Method to return the action request object |
||
48 | * |
||
49 | * @param Array $headers |
||
50 | * @param string $body |
||
51 | * @return \GuzzleHttp\Psr7\Request |
||
52 | */ |
||
53 | 39 | public function getRequest(Array $headers = [], $body = '') |
|
70 | ); |
||
71 | } |
||
73 |