| 1 | <?php |
||
| 12 | abstract class AbstractAPI |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Client |
||
| 16 | */ |
||
| 17 | protected $client; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var GuzzleHttp\Client |
||
| 21 | */ |
||
| 22 | protected $httpClient; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $url; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | protected $endpoint; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @var array |
||
| 36 | */ |
||
| 37 | protected $headers = [ |
||
| 38 | 'Content-Type' => 'application/json; charset=utf-8', |
||
| 39 | 'Accept' => 'application/json', |
||
| 40 | ]; |
||
| 41 | |||
| 42 | /** |
||
| 43 | * AbstractAPI constructor. |
||
| 44 | * |
||
| 45 | * @param null $endpoint |
||
| 46 | * @param Client|null $client |
||
| 47 | * @throws \Exception |
||
| 48 | */ |
||
| 49 | protected function __construct($endpoint = null, Client $client = null) |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @param null $endpoint |
||
| 56 | * @param Client|null $client |
||
| 57 | * @throws \Exception |
||
| 58 | */ |
||
| 59 | private function httpClientInitialize($endpoint = null, Client $client = null) |
||
| 87 | |||
| 88 | } |