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