Passed
Push — master ( 420501...55c755 )
by Vladislav
04:26 queued 02:03
created

InstrumentInfoRequest   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 101
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 18
dl 0
loc 101
rs 10
c 0
b 0
f 0
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setCategory() 0 4 1
A getSymbol() 0 3 1
A setSymbol() 0 4 1
A getCursor() 0 3 1
A setLimit() 0 4 1
A setCursor() 0 4 1
A getCategory() 0 3 1
A __construct() 0 3 1
A getLimit() 0 3 1
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\MarketData\InstrumentInfo\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
6
class InstrumentInfoRequest extends AbstractParameters
7
{
8
    /**
9
     * Product type. linear only supports at now
10
     * @var string $category
11
     */
12
    protected string $category = "linear";
13
14
    /**
15
     * Symbol name. query an option symbol, category is required
16
     * @var string $symbol
17
     */
18
    protected string $symbol;
19
20
    /**
21
     * Limit for data size per page. [1, 1000]. Default: 500
22
     * @var int $limit
23
     */
24
    protected int $limit = 500;
25
26
    /**
27
     * Cursor. Used for pagination
28
     * @var string $cursor
29
     */
30
    protected string $cursor;
31
32
    public function __construct()
33
    {
34
        $this->setRequiredField('symbol');
35
    }
36
37
    /**
38
     * @return string
39
     */
40
    public function getSymbol(): string
41
    {
42
        return $this->symbol;
43
    }
44
45
    /**
46
     * @param string $symbol
47
     * @return InstrumentInfoRequest
48
     */
49
    public function setSymbol(string $symbol): self
50
    {
51
        $this->symbol = $symbol;
52
        return $this;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getCategory(): string
59
    {
60
        return $this->category;
61
    }
62
63
    /**
64
     * @param string $category
65
     * @return InstrumentInfoRequest
66
     */
67
    public function setCategory(string $category): self
68
    {
69
        $this->category = $category;
70
        return $this;
71
    }
72
73
    /**
74
     * @return int
75
     */
76
    public function getLimit(): int
77
    {
78
        return $this->limit;
79
    }
80
81
    /**
82
     * @param int $limit
83
     * @return InstrumentInfoRequest
84
     */
85
    public function setLimit(int $limit): self
86
    {
87
        $this->limit = $limit;
88
        return $this;
89
    }
90
91
    /**
92
     * @return string
93
     */
94
    public function getCursor(): string
95
    {
96
        return $this->cursor;
97
    }
98
99
    /**
100
     * @param string $cursor
101
     * @return InstrumentInfoRequest
102
     */
103
    public function setCursor(string $cursor): self
104
    {
105
        $this->cursor = $cursor;
106
        return $this;
107
    }
108
}