Total Complexity | 7 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class OHLCDataRequest implements RequestInterface |
||
13 | { |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $pair; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | private $interval; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | private $since; |
||
29 | |||
30 | /** |
||
31 | * OHLCDataRequest constructor. |
||
32 | * @param string $pair |
||
33 | * @param int $interval |
||
34 | * @param int $since |
||
35 | */ |
||
36 | 2 | public function __construct($pair, $interval, $since) |
|
37 | { |
||
38 | 2 | $this->pair = $pair; |
|
39 | 2 | $this->interval = $interval; |
|
40 | 2 | $this->since = $since; |
|
41 | 2 | } |
|
42 | |||
43 | /** |
||
44 | * Returns the api request name |
||
45 | * |
||
46 | * @return string |
||
47 | */ |
||
48 | 1 | public function getMethod() |
|
49 | { |
||
50 | 1 | return 'OHLC'; |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @return string |
||
55 | */ |
||
56 | 1 | public function getVisibility() |
|
57 | { |
||
58 | 1 | return VisibilityEnum::VISIBILITY_PUBLIC; |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return array |
||
63 | */ |
||
64 | 1 | public function getRequestData() |
|
65 | { |
||
66 | 1 | $ret = []; |
|
67 | 1 | $ret["pair"] = $this->pair; |
|
68 | 1 | if (null !== $this->interval) { |
|
69 | 1 | $ret["interval"] = $this->interval; |
|
70 | 1 | } |
|
71 | 1 | if (null !== $this->since) { |
|
72 | 1 | $ret["since"] = $this->since; |
|
73 | 1 | } |
|
74 | 1 | return $ret; |
|
75 | } |
||
76 | |||
77 | /** |
||
78 | * @return string |
||
79 | */ |
||
80 | 1 | public function getResponseClassName() |
|
83 | } |
||
84 | } |
||
85 |