| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | class PublicApi extends Api |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @return string |
||
| 17 | */ |
||
| 18 | 1 | public function getTimestamp(): string |
|
| 19 | { |
||
| 20 | 1 | $response = $this->getBaseClient()->get('/timestamp'); |
|
| 21 | |||
| 22 | 1 | return (string) $response->getBody(); |
|
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param string $symbols |
||
| 27 | * @return array |
||
| 28 | * @throws TransformResponseException |
||
| 29 | */ |
||
| 30 | 1 | public function getTickers(string $symbols): array |
|
| 31 | { |
||
| 32 | 1 | $response = $this->getBaseClient()->get('/tickers/' . strtolower($symbols)); |
|
| 33 | |||
| 34 | 1 | return $this->getTransformer()->transform($response); |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $market |
||
| 39 | * @return array |
||
| 40 | * @throws TransformResponseException |
||
| 41 | */ |
||
| 42 | 1 | public function getDepth(string $market): array |
|
| 43 | { |
||
| 44 | 1 | $query = http_build_query(['market' => strtolower($market)]); |
|
| 45 | 1 | echo $query; |
|
| 46 | 1 | $response = $this->getBaseClient()->get('/depth?' . $query); |
|
| 47 | |||
| 48 | 1 | return $this->getTransformer()->transform($response); |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @param string $market |
||
| 53 | * @return array |
||
| 54 | * @throws TransformResponseException |
||
| 55 | */ |
||
| 56 | 1 | public function getTrades(string $market): array |
|
| 63 | } |
||
| 64 | } |
||
| 65 |