Requests
11 months ago
CurlHttpClient.php
11 months ago
DummyHttpClient.php
11 months ago
WordPressHttpClient.php
11 months ago
DummyHttpClient.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Analyst\Http; |
| 4 | |
| 5 | use Analyst\ApiResponse; |
| 6 | use Analyst\Contracts\HttpClientContract; |
| 7 | |
| 8 | class DummyHttpClient implements HttpClientContract |
| 9 | { |
| 10 | /** |
| 11 | * Make an http request |
| 12 | * |
| 13 | * @param $method |
| 14 | * @param $url |
| 15 | * @param $body |
| 16 | * @param $headers |
| 17 | * @return ApiResponse |
| 18 | */ |
| 19 | public function request($method, $url, $body, $headers) |
| 20 | { |
| 21 | return new ApiResponse('Dummy response', 200, []); |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Must return `true` if client is supported |
| 26 | * |
| 27 | * @return bool |
| 28 | */ |
| 29 | public static function hasSupport() |
| 30 | { |
| 31 | return true; |
| 32 | } |
| 33 | } |
| 34 |