1 | <?php |
||
8 | abstract class Guzzle |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $baseUri; |
||
14 | |||
15 | /** |
||
16 | * @param string $baseUri |
||
17 | */ |
||
18 | public function __construct($baseUri) |
||
19 | { |
||
20 | $this->baseUri = $baseUri; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * @return string |
||
25 | */ |
||
26 | public function getBaseUri() |
||
27 | { |
||
28 | return $this->baseUri; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @param string $baseUri |
||
33 | * |
||
34 | * @return self |
||
35 | */ |
||
36 | public function setBaseUri($baseUri) |
||
37 | { |
||
38 | $this->baseUri = $baseUri; |
||
39 | |||
40 | return $this; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param Request $request |
||
45 | * |
||
46 | * @return Response |
||
47 | */ |
||
48 | abstract public function send(Request $request); |
||
49 | |||
50 | /** |
||
51 | * @param string $method |
||
52 | * @param string $uri |
||
53 | * @param string[] $headers |
||
54 | * @param string $body |
||
55 | * |
||
56 | * @return Response |
||
57 | */ |
||
58 | public function call($method, $uri, $headers = array(), $body = null) |
||
66 | |||
67 | /** |
||
68 | * @param string $uri |
||
69 | * @param string[] $headers |
||
70 | * @param string $body |
||
71 | * |
||
72 | * @return Response |
||
73 | */ |
||
74 | public function get($uri, $headers = array(), $body = null) |
||
78 | |||
79 | /** |
||
80 | * @param string $uri |
||
81 | * @param string[] $headers |
||
82 | * @param string $body |
||
83 | * |
||
84 | * @return Response |
||
85 | */ |
||
86 | public function post($uri, $headers = array(), $body = null) |
||
90 | |||
91 | /** |
||
92 | * @param string $uri |
||
93 | * @param string[] $headers |
||
94 | * @param string $body |
||
95 | * |
||
96 | * @return Response |
||
97 | */ |
||
98 | public function put($uri, $headers = array(), $body = null) |
||
102 | |||
103 | /** |
||
104 | * @param string $uri |
||
105 | * @param string[] $headers |
||
106 | * @param string $body |
||
107 | * |
||
108 | * @return Response |
||
109 | */ |
||
110 | public function patch($uri, $headers = array(), $body = null) |
||
114 | |||
115 | /** |
||
116 | * @param string $uri |
||
117 | * @param string[] $headers |
||
118 | * @param string $body |
||
119 | * |
||
120 | * @return Response |
||
121 | */ |
||
122 | public function delete($uri, $headers = array(), $body = null) |
||
126 | |||
127 | /** |
||
128 | * @param string $uri |
||
129 | * @param string[] $headers |
||
130 | * @param string $body |
||
131 | * |
||
132 | * @return Response |
||
133 | */ |
||
134 | public function head($uri, $headers = array(), $body = null) |
||
138 | } |
||
139 |