Completed
Push — master ( 686c2f...4df82b )
by Mikhail
01:33
created

PublicApi::getMarkets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace R3bers\BittrexApi\Api;
6
7
use Exception;
8
9
/**
10
 * Class PublicApi
11
 * @package R3bers\BittrexApi\Api
12
 */
13
class PublicApi extends Api
14
{
15
    /**
16
     * @return array
17
     * @throws Exception
18
     */
19 1
    public function getMarkets(): array
20
    {
21 1
        return $this->rest('GET', '/markets');
22
    }
23
24
    /**
25
     * @return array
26
     * @throws Exception
27
     */
28 1
    public function getCurrencies(): array
29
    {
30 1
        return $this->rest('GET', '/currencies');
31
    }
32
33
    /**
34
     * @param string $market
0 ignored issues
show
Bug introduced by
There is no parameter named $market. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
35
     * @return array
36
     * @throws Exception
37
     */
38 1
    public function getTickers(): array
39
    {
40 1
        return $this->rest('HEAD', '/markets/tickers');
41
    }
42
43
    /**
44
     * @param string $market
45
     * @return array
46
     * @throws Exception
47
     */
48 1
    public function getTicker(string $market): array
49
    {
50 1
        return $this->rest('GET', '/markets/' . $market . '/ticker');
51
    }
52
53
    /**
54
     * @return array
55
     * @throws Exception
56
     */
57 1
    public function getMarketSummaries(): array
58
    {
59 1
        return $this->rest('GET', '/markets/summaries');
60
    }
61
62
    /**
63
     * @param string $market
64
     * @return array
65
     * @throws Exception
66
     */
67 1
    public function getMarketSummary(string $market): array
68
    {
69 1
        return $this->rest('GET', '/markets/' . $market . '/summary');
70
    }
71
72
    /**
73
     * @param string $market
74
     * @param int $depth
75
     * @return array
76
     * @throws Exception
77
     */
78 1
    public function getOrderBook(string $market, $depth = 25): array
79
    {
80 1
        $options = ['query' => ['depth' => $depth]];
81
82 1
        return $this->rest('GET', '/markets/' . $market . '/orderbook', $options);
83
    }
84
85
    /**
86
     * @param string $market
87
     * @return array
88
     * @throws Exception
89
     */
90 1
    public function getMarketHistory(string $market)
91
    {
92 1
        return $this->rest('GET', '/markets/' . $market . '/trades');
93
    }
94
95
    /**
96
     * @return array
97
     * @throws Exception
98
     */
99 1
    public function ping(): array
100
    {
101 1
        return $this->rest('GET', '/ping');
102
    }
103
104
}
105