OpenOrdersRequest   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 97
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
c 0
b 0
f 0
dl 0
loc 97
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getSymbol() 0 3 1
A setOrderCategory() 0 4 1
A getOrderCategory() 0 3 1
A setSymbol() 0 4 1
A getOrderId() 0 3 1
A getLimit() 0 3 1
A setLimit() 0 4 1
A setOrderId() 0 4 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Spot\Trade\OpenOrders\Request;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
6
use Carpenstar\ByBitAPI\Spot\Trade\OpenOrders\Interfaces\IOpenOrdersRequestInterface;
7
8
class OpenOrdersRequest extends AbstractParameters implements IOpenOrdersRequestInterface
9
{
10
    /**
11
     * Name of the trading pair
12
     * @var string $symbol
13
     */
14
    protected string $symbol;
15
16
    /**
17
     * Specify orderId to return all the orders that orderId of which are smaller than
18
     * this particular one for pagination purpose
19
     * @var int $orderId
20
     */
21
    protected int $orderId;
22
23
    /**
24
     * Limit for data size. [1, 500]. Default: 500
25
     * @var int $limit
26
     */
27
    protected int $limit = 500;
28
29
    /**
30
     * Order category. 0:normal order by default; 1:TP/SL order, Required for TP/SL order.
31
     * @var int $orderCategory
32
     */
33
    protected int $orderCategory;
34
35
    /**
36
     * @param string $symbol
37
     * @return $this
38
     */
39
    public function setSymbol(string $symbol): self
40
    {
41
        $this->symbol = $symbol;
42
        return $this;
43
    }
44
45
    /**
46
     * @return string
47
     */
48
    public function getSymbol(): string
49
    {
50
        return $this->symbol;
51
    }
52
53
    /**
54
     * @param int $orderId
55
     * @return OpenOrdersRequest
56
     */
57
    public function setOrderId(int $orderId): self
58
    {
59
        $this->orderId = $orderId;
60
        return $this;
61
    }
62
63
    /**
64
     * @return int
65
     */
66
    public function getOrderId(): int
67
    {
68
        return $this->orderId;
69
    }
70
71
    /**
72
     * @param int $limit
73
     * @return OpenOrdersRequest
74
     */
75
    public function setLimit(int $limit): self
76
    {
77
        $this->limit = $limit;
78
        return $this;
79
    }
80
81
    /**
82
     * @return int
83
     */
84
    public function getLimit(): int
85
    {
86
        return $this->limit;
87
    }
88
89
    /**
90
     * @param int $orderCategory
91
     * @return OpenOrdersRequest
92
     */
93
    public function setOrderCategory(int $orderCategory): self
94
    {
95
        $this->orderCategory = $orderCategory;
96
        return $this;
97
    }
98
99
    /**
100
     * @return int
101
     */
102
    public function getOrderCategory(): int
103
    {
104
        return $this->orderCategory;
105
    }
106
}
107