Passed
Pull Request — master (#10)
by Vladislav
03:04
created

SetLeverageRequest::setSymbol()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\SetLeverage\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\SetLeverage\Interfaces\ISetLeverageRequestInterface;
6
7
class SetLeverageRequest extends AbstractParameters implements ISetLeverageRequestInterface
8
{
9
    /**
10
     * Symbol name
11
     * @var string $symbol
12
     */
13
    protected string $symbol;
14
15
    /**
16
     * (0, max leverage of corresponding risk limit]. For one-way mode, make sure buyLeverage=sellLeverage
17
     * @var float $buyLeverage
18
     */
19
    protected float $buyLeverage;
20
21
    /**
22
     * (0, max leverage of corresponding risk limit]. For one-way mode, make sure buyLeverage=sellLeverage
23
     * @var float $sellLeverage
24
     */
25
    protected float $sellLeverage;
26
27
    public function __construct()
28
    {
29
        $this
30
            ->setRequiredField('symbol')
31
            ->setRequiredField('buyLeverage')
32
            ->setRequiredField('sellLeverage');
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getSymbol(): string
39
    {
40
        return $this->symbol;
41
    }
42
43
    /**
44
     * @param string $symbol
45
     * @return SetLeverageRequest
46
     */
47
    public function setSymbol(string $symbol): self
48
    {
49
        $this->symbol = $symbol;
50
        return $this;
51
    }
52
53
    /**
54
     * @return float
55
     */
56
    public function getBuyLeverage(): float
57
    {
58
        return $this->buyLeverage;
59
    }
60
61
    /**
62
     * @param float $buyLeverage
63
     * @return SetLeverageRequest
64
     */
65
    public function setBuyLeverage(float $buyLeverage): self
66
    {
67
        $this->buyLeverage = $buyLeverage;
68
        return $this;
69
    }
70
71
    /**
72
     * @return float
73
     */
74
    public function getSellLeverage(): float
75
    {
76
        return $this->sellLeverage;
77
    }
78
79
    /**
80
     * @param float $sellLeverage
81
     * @return SetLeverageRequest
82
     */
83
    public function setSellLeverage(float $sellLeverage): self
84
    {
85
        $this->sellLeverage = $sellLeverage;
86
        return $this;
87
    }
88
89
90
}