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