/
Adapter.php
76 lines (68 loc) · 1.75 KB
/
Adapter.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* User: junade
* Date: 13/01/2017
* Time: 16:06
*/
namespace Cloudflare\API\Adapter;
use Cloudflare\API\Auth\Auth;
use Psr\Http\Message\ResponseInterface;
/**
* Interface Adapter
* @package Cloudflare\API\Adapter
* Note that the $body fields expect a JSON key value store.
*/
interface Adapter
{
/**
* Adapter constructor.
*
* @param Auth $auth
* @param string $baseURI
*/
public function __construct(Auth $auth, string $baseURI);
/**
* Sends a GET request.
* Per Robustness Principle - not including the ability to send a body with a GET request (though possible in the
* RFCs, it is never useful).
*
* @param string $uri
* @param array $data
* @param array $headers
*
* @return mixed
*/
public function get(string $uri, array $data = [], array $headers = []): ResponseInterface;
/**
* @param string $uri
* @param array $data
* @param array $headers
*
* @return mixed
*/
public function post(string $uri, array $data = [], array $headers = []): ResponseInterface;
/**
* @param string $uri
* @param array $data
* @param array $headers
*
* @return mixed
*/
public function put(string $uri, array $data = [], array $headers = []): ResponseInterface;
/**
* @param string $uri
* @param array $data
* @param array $headers
*
* @return mixed
*/
public function patch(string $uri, array $data = [], array $headers = []): ResponseInterface;
/**
* @param string $uri
* @param array $data
* @param array $headers
*
* @return mixed
*/
public function delete(string $uri, array $data = [], array $headers = []): ResponseInterface;
}