1 | <?php |
||
25 | class GuzzleHttpAdapter implements HttpAdapterInterface |
||
26 | { |
||
27 | /** @var ServerRequest */ |
||
28 | private $request; |
||
29 | /** @var ResponseInterface */ |
||
30 | private $response; |
||
31 | |||
32 | /** @var array */ |
||
33 | private $get; |
||
34 | /** @var array */ |
||
35 | private $post; |
||
36 | /** @var array */ |
||
37 | private $server; |
||
38 | /** @var array */ |
||
39 | private $cookie; |
||
40 | /** @var array */ |
||
41 | private $files; |
||
42 | |||
43 | /** |
||
44 | * GuzzleHTTPAdapter constructor. |
||
45 | * |
||
46 | * @param array $get |
||
47 | * @param array $post |
||
48 | * @param array $server |
||
49 | * @param array $cookie |
||
50 | * @param array $files |
||
51 | */ |
||
52 | 4 | public function __construct(array $get, array $post, array $server, array $cookie, array $files) |
|
62 | |||
63 | /** |
||
64 | * Initialize adapter: create the ServerRequest and Response instances. |
||
65 | */ |
||
66 | 4 | private function initialize() |
|
90 | |||
91 | /** |
||
92 | * Gets the specific server data, or a default value if not present. |
||
93 | * |
||
94 | * @param string $keyName |
||
95 | * @param mixed $defaultValue |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 4 | private function getServerData($keyName, $defaultValue = '') |
|
107 | |||
108 | /** |
||
109 | * Gets server scheme. |
||
110 | * |
||
111 | * @return string |
||
112 | */ |
||
113 | 4 | private function getScheme() |
|
124 | |||
125 | /** |
||
126 | * Gets the server host name. |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 4 | private function getHost() |
|
141 | |||
142 | /** |
||
143 | * Gets the server request uri. |
||
144 | * |
||
145 | * @return string |
||
146 | */ |
||
147 | 4 | private function getRequestUri() |
|
153 | |||
154 | /** |
||
155 | * Gets the server protocol. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | 4 | private function getProtocol() |
|
170 | |||
171 | /** |
||
172 | * Returns the HTTP request. |
||
173 | * |
||
174 | * @return ServerRequestInterface |
||
175 | */ |
||
176 | 1 | public function getRequest() |
|
180 | |||
181 | /** |
||
182 | * Returns the response being sent. |
||
183 | * |
||
184 | * @return ResponseInterface |
||
185 | */ |
||
186 | 1 | public function getResponse() |
|
190 | } |
||
191 |