1
|
|
|
<?php |
2
|
|
|
namespace Carpenstar\ByBitAPI\Spot\MarketData\Kline\Request; |
3
|
|
|
|
4
|
|
|
|
5
|
|
|
use Carpenstar\ByBitAPI\Core\Enums\EnumIntervals; |
6
|
|
|
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters; |
7
|
|
|
|
8
|
|
|
class KlineRequest extends AbstractParameters |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* Name of the trading pair |
12
|
|
|
* @required true |
13
|
|
|
* @var string $symbol |
14
|
|
|
*/ |
15
|
|
|
protected string $symbol; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* Chart interval. See list intervals in |
19
|
|
|
* @required true |
20
|
|
|
* @var string $interval |
21
|
|
|
*/ |
22
|
|
|
protected string $interval = EnumIntervals::MINUTE1; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Limit for data size. [1, 1000]. Default: 1000 |
26
|
|
|
* @required false |
27
|
|
|
* @var int $limit |
28
|
|
|
*/ |
29
|
|
|
protected int $limit = 1000; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Start time (ms) |
33
|
|
|
* @required false |
34
|
|
|
* @var int $startTime |
35
|
|
|
*/ |
36
|
|
|
protected int $startTime; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* End time (ms) |
40
|
|
|
* @required false |
41
|
|
|
* @var int $endTime |
42
|
|
|
*/ |
43
|
|
|
protected int $endTime; |
44
|
|
|
|
45
|
|
|
public function __construct() |
46
|
|
|
{ |
47
|
|
|
$this |
48
|
|
|
->setRequiredField('symbol') |
49
|
|
|
->setRequiredField('interval'); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* @param string $symbol |
54
|
|
|
* @return KlineRequestEntity |
|
|
|
|
55
|
|
|
*/ |
56
|
|
|
public function setSymbol(string $symbol): self |
57
|
|
|
{ |
58
|
|
|
$this->symbol = $symbol; |
59
|
|
|
return $this; |
|
|
|
|
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @return string |
64
|
|
|
*/ |
65
|
|
|
public function getSymbol(): string |
66
|
|
|
{ |
67
|
|
|
return $this->symbol; |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @param int $limit |
72
|
|
|
* @return KlineRequestEntity |
73
|
|
|
*/ |
74
|
|
|
public function setLimit(int $limit): self |
75
|
|
|
{ |
76
|
|
|
$this->limit = $limit; |
77
|
|
|
return $this; |
|
|
|
|
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return int |
82
|
|
|
*/ |
83
|
|
|
public function getLimit(): int |
84
|
|
|
{ |
85
|
|
|
return $this->limit; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @param string $interval |
90
|
|
|
* @return KlineRequestEntity |
91
|
|
|
*/ |
92
|
|
|
public function setInterval(string $interval): self |
93
|
|
|
{ |
94
|
|
|
$this->interval = $interval; |
95
|
|
|
return $this; |
|
|
|
|
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return string |
100
|
|
|
*/ |
101
|
|
|
public function getInterval(): string |
102
|
|
|
{ |
103
|
|
|
return $this->interval; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @param int $startTime |
108
|
|
|
* @return KlineRequestEntity |
109
|
|
|
*/ |
110
|
|
|
public function setStartTime(int $startTime): self |
111
|
|
|
{ |
112
|
|
|
$this->startTime = $startTime; |
113
|
|
|
return $this; |
|
|
|
|
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return int |
118
|
|
|
*/ |
119
|
|
|
public function getStartTime(): int |
120
|
|
|
{ |
121
|
|
|
return $this->startTime; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param int $endTime |
126
|
|
|
* @return KlineRequestEntity |
127
|
|
|
*/ |
128
|
|
|
public function setEndTime(int $endTime): self |
129
|
|
|
{ |
130
|
|
|
$this->endTime = $endTime; |
131
|
|
|
return $this; |
|
|
|
|
132
|
|
|
} |
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @return int |
136
|
|
|
*/ |
137
|
|
|
public function getEndTime(): int |
138
|
|
|
{ |
139
|
|
|
return $this->endTime; |
140
|
|
|
} |
141
|
|
|
} |
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