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

OrderBookRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 55
rs 10
c 0
b 0
f 0
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setLimit() 0 4 1
A __construct() 0 3 1
A setSymbol() 0 4 1
A getLimit() 0 3 1
A getSymbol() 0 3 1
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
}