Completed
Push — master ( 3ad417...37b5d9 )
by Fabian
02:10
created

TickerAbstractRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\GetTicker;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\AbstractRequest;
7
8
/**
9
 * Class GetServerTime
10
 *
11
 * @package HanischIt\KrakenApi\Model\GetTicker
12
 */
13
class TickerAbstractRequest extends AbstractRequest
14
{
15
16
    /**
17
     * @var array
18
     */
19
    private $pairs;
20
21
    /**
22
     * TicketRequest constructor.
23
     *
24
     * @param array $pairs
25
     */
26 2
    public function __construct(array $pairs)
27
    {
28 2
        $this->pairs = $pairs;
29 2
    }
30
31
    /**
32
     * Returns the api request name
33
     *
34
     * @return string
35
     */
36 1
    public function getMethod()
37
    {
38 1
        return 'Ticker';
39
    }
40
41
    /**
42
     * @return string
43
     */
44 1
    public function getVisibility()
45
    {
46 1
        return VisibilityEnum::VISIBILITY_PUBLIC;
47
    }
48
49
    /**
50
     * @return array
51
     */
52 1
    public function getRequestData()
53
    {
54 1
        return ["pair" => implode(",", $this->pairs)];
55
    }
56
57
    /**
58
     * @return string
59
     */
60 1
    public function getResponseClassName()
61
    {
62 1
        return TickerResponse::class;
63
    }
64
}
65