| 1 | <?php |
||
| 13 | class StarCitizensClient |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * Base url |
||
| 17 | */ |
||
| 18 | const APIURL = "http://sc-api.com"; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var Client |
||
| 22 | */ |
||
| 23 | private $client; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * StarCitizensClient constructor. |
||
| 27 | */ |
||
| 28 | 1 | public function __construct() |
|
| 29 | { |
||
| 30 | 1 | $this->client = new Client( |
|
| 31 | [ |
||
| 32 | 1 | 'http_error' => false, |
|
| 33 | 'base_uri' => StarCitizensClient::APIURL |
||
| 34 | ] |
||
| 35 | ); |
||
| 36 | 1 | } |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Gets th result based on the params. |
||
| 40 | * |
||
| 41 | * @param array $params |
||
| 42 | * |
||
| 43 | * @return mixed|\Psr\Http\Message\ResponseInterface |
||
| 44 | */ |
||
| 45 | 19 | public function getResult($params = []) |
|
| 50 | } |