|
1
|
|
|
<?php |
|
2
|
|
|
namespace Carpenstar\ByBitAPI\Derivatives\MarketData\IndexPriceKline\Request; |
|
3
|
|
|
|
|
4
|
|
|
use Carpenstar\ByBitAPI\Core\Enums\DerivativesCategoryEnum; |
|
|
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Enums\EnumDerivativesCategory; |
|
6
|
|
|
use Carpenstar\ByBitAPI\Core\Enums\EnumIntervals; |
|
7
|
|
|
use Carpenstar\ByBitAPI\Core\Enums\IntervalEnum; |
|
|
|
|
|
|
8
|
|
|
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper; |
|
9
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
|
10
|
|
|
|
|
11
|
|
|
class IndexPriceKlineRequest extends AbstractParameters |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* Product type. linear,inverse. Default: linear, but in the response category shows |
|
15
|
|
|
* @var string $category |
|
16
|
|
|
*/ |
|
17
|
|
|
protected string $category = EnumDerivativesCategory::CATEGORY_PRODUCT_LINEAR; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Symbol name |
|
21
|
|
|
* @var string $symbol |
|
22
|
|
|
*/ |
|
23
|
|
|
protected string $symbol; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Kline interval. 1 3 5 15 30 60 120 240 360 720 D M W |
|
27
|
|
|
* @var string $interval |
|
28
|
|
|
*/ |
|
29
|
|
|
protected string $interval = EnumIntervals::MINUTE1; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* The start timestamp (ms) |
|
33
|
|
|
* @var string $start |
|
34
|
|
|
*/ |
|
35
|
|
|
protected string $start; |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* The end timestamp (ms) |
|
39
|
|
|
* @var string $end |
|
40
|
|
|
*/ |
|
41
|
|
|
protected string $end; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* Limit for data size per page. [1, 200]. Default: 200 |
|
45
|
|
|
* @var int $limit |
|
46
|
|
|
*/ |
|
47
|
|
|
protected int $limit = 200; |
|
48
|
|
|
|
|
49
|
|
|
public function __construct() |
|
50
|
|
|
{ |
|
51
|
|
|
$this |
|
52
|
|
|
->setRequiredField('symbol') |
|
53
|
|
|
->setRequiredField('interval') |
|
54
|
|
|
->setRequiredField('start') |
|
55
|
|
|
->setRequiredField('end'); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @param string $category |
|
60
|
|
|
* @return $this |
|
61
|
|
|
*/ |
|
62
|
|
|
public function setCategory(string $category): self |
|
63
|
|
|
{ |
|
64
|
|
|
$this->category = $category; |
|
65
|
|
|
return $this; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @return string |
|
70
|
|
|
*/ |
|
71
|
|
|
public function getCategory(): string |
|
72
|
|
|
{ |
|
73
|
|
|
return $this->category; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @param string $symbol |
|
78
|
|
|
* @return IndexPriceKlineRequest |
|
79
|
|
|
*/ |
|
80
|
|
|
public function setSymbol(string $symbol): self |
|
81
|
|
|
{ |
|
82
|
|
|
$this->symbol = $symbol; |
|
83
|
|
|
return $this; |
|
84
|
|
|
} |
|
85
|
|
|
|
|
86
|
|
|
/** |
|
87
|
|
|
* @return string |
|
88
|
|
|
*/ |
|
89
|
|
|
public function getSymbol(): string |
|
90
|
|
|
{ |
|
91
|
|
|
return $this->symbol; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* @param string $interval |
|
96
|
|
|
* @return IndexPriceKlineRequest |
|
97
|
|
|
*/ |
|
98
|
|
|
public function setInterval(string $interval): self |
|
99
|
|
|
{ |
|
100
|
|
|
$this->interval = $interval; |
|
101
|
|
|
return $this; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* @return string |
|
106
|
|
|
*/ |
|
107
|
|
|
public function getInterval(): string |
|
108
|
|
|
{ |
|
109
|
|
|
return $this->interval; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* @param string $start |
|
114
|
|
|
* @return IndexPriceKlineRequest |
|
115
|
|
|
*/ |
|
116
|
|
|
public function setStart(string $start): self |
|
117
|
|
|
{ |
|
118
|
|
|
$this->start = DateTimeHelper::makeTimestampFromDateString($start); |
|
119
|
|
|
return $this; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @return string |
|
124
|
|
|
*/ |
|
125
|
|
|
public function getStart(): string |
|
126
|
|
|
{ |
|
127
|
|
|
return $this->start; |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @param string $end |
|
132
|
|
|
* @return IndexPriceKlineRequest |
|
133
|
|
|
*/ |
|
134
|
|
|
public function setEnd(string $end): self |
|
135
|
|
|
{ |
|
136
|
|
|
$this->end = DateTimeHelper::makeTimestampFromDateString($end); |
|
137
|
|
|
return $this; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* @return string |
|
142
|
|
|
*/ |
|
143
|
|
|
public function getEnd(): string |
|
144
|
|
|
{ |
|
145
|
|
|
return $this->end; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
/** |
|
149
|
|
|
* @param int $limit |
|
150
|
|
|
* @return IndexPriceKlineRequest |
|
151
|
|
|
*/ |
|
152
|
|
|
public function setLimit(int $limit): self |
|
153
|
|
|
{ |
|
154
|
|
|
$this->limit = $limit; |
|
155
|
|
|
return $this; |
|
156
|
|
|
} |
|
157
|
|
|
|
|
158
|
|
|
/** |
|
159
|
|
|
* @return int |
|
160
|
|
|
*/ |
|
161
|
|
|
public function getLimit(): int |
|
162
|
|
|
{ |
|
163
|
|
|
return $this->limit; |
|
164
|
|
|
} |
|
165
|
|
|
} |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths