Passed
Pull Request — master (#7)
by Vladislav
03:08
created

OrderBookRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Carpenstar\ByBitAPI\Spot\MarketData\OrderBook\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
6
class OrderBookRequest extends AbstractParameters
7
{
8
    /**
9
     * Symbol
10
     * @required true
11
     * @var string $symbol
12
     */
13
    protected string $symbol;
14
15
    /**
16
     * Limit for data size. [1, 200]. Default: 100
17
     * @required false
18
     * @var int $limit
19
     */
20
    protected int $limit = 100;
21
22
    public function __construct()
23
    {
24
        $this->setRequiredField('symbol');
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getSymbol(): string
31
    {
32
        return $this->symbol;
33
    }
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 int
47
     */
48
    public function getLimit(): int
49
    {
50
        return $this->limit;
51
    }
52
53
    /**
54
     * @param int $limit
55
     * @return $this
56
     */
57
    public function setLimit(int $limit): self
58
    {
59
        $this->limit = $limit;
60
        return $this;
61
    }
62
}