PublicApi   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 12
c 1
b 0
f 0
dl 0
loc 76
ccs 18
cts 18
cp 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getMarketSummary() 0 5 1
A getMarketHistory() 0 5 1
A getCurrencies() 0 3 1
A getTicker() 0 5 1
A getOrderBook() 0 5 1
A getMarkets() 0 3 1
A getMarketSummaries() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Codenixsv\BittrexApi\Api;
6
7
use Exception;
8
9
/**
10
 * Class PublicApi
11
 * @package Codenixsv\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->get('/public/getmarkets');
22
    }
23
24
    /**
25
     * @return array
26
     * @throws Exception
27
     */
28 1
    public function getCurrencies(): array
29
    {
30 1
        return $this->get('/public/getcurrencies');
31
    }
32
33
    /**
34
     * @param string $market
35
     * @return array
36
     * @throws Exception
37
     */
38 1
    public function getTicker(string $market): array
39
    {
40 1
        $parameters = ['market' => $market];
41
42 1
        return $this->get('/public/getticker', $parameters);
43
    }
44
45
    /**
46
     * @return array
47
     * @throws Exception
48
     */
49 1
    public function getMarketSummaries(): array
50
    {
51 1
        return $this->get('/public/getmarketsummaries');
52
    }
53
54
    /**
55
     * @param string $market
56
     * @return array
57
     * @throws Exception
58
     */
59 1
    public function getMarketSummary(string $market): array
60
    {
61 1
        $parameters = ['market' => $market];
62
63 1
        return $this->get('/public/getmarketsummary', $parameters);
64
    }
65
66
    /**
67
     * @param string $market
68
     * @param string $type
69
     * @return array
70
     * @throws Exception
71
     */
72 1
    public function getOrderBook(string $market, $type = 'both'): array
73
    {
74 1
        $parameters = ['market' => $market, 'type' => $type];
75
76 1
        return $this->get('/public/getorderbook', $parameters);
77
    }
78
79
    /**
80
     * @param string $market
81
     * @return array
82
     * @throws Exception
83
     */
84 1
    public function getMarketHistory(string $market)
85
    {
86 1
        $parameters = ['market' => $market];
87
88 1
        return $this->get('/public/getmarkethistory', $parameters);
89
    }
90
}
91