PublicApi::getTimestamp()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Codenixsv\KunaApi\Api;
6
7
use Codenixsv\KunaApi\Exception\TransformResponseException;
8
9
/**
10
 * Class PublicApi
11
 * @package Codenixsv\KunaApi\Api
12
 */
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
57
    {
58 1
        $query = http_build_query(['market' => strtolower($market)]);
59 1
        echo $query;
60 1
        $response = $this->getBaseClient()->get('/trades?' . $query);
61
62 1
        return $this->getTransformer()->transform($response);
63
    }
64
}
65