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

MyPositionRequest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 53
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setSymbol() 0 4 1
A __construct() 0 3 1
A getSymbol() 0 3 1
A getSettleCoin() 0 3 1
A setSettleCoin() 0 4 1
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\MyPosition\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\MyPosition\Interfaces\IMyPositionRequestInterface;
6
7
class MyPositionRequest extends AbstractParameters implements IMyPositionRequestInterface
8
{
9
    /**
10
     * Symbol name
11
     * @var string $symbol
12
     */
13
    protected string $symbol;
14
15
    /**
16
     * Settle coin. Either symbol or settleCoin is required. symbol has a higher priority
17
     * @var string $settleCoin
18
     */
19
    protected string $settleCoin;
20
21
    public function __construct()
22
    {
23
        $this->setRequiredBetweenField("symbol", "settleCoin");
24
    }
25
26
    /**
27
     * @param string $symbol
28
     * @return $this
29
     */
30
    public function setSymbol(string $symbol): self
31
    {
32
        $this->symbol = $symbol;
33
        return $this;
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getSymbol(): string
40
    {
41
        return $this->symbol;
42
    }
43
44
    /**
45
     * @param string $symbol
46
     * @return $this
47
     */
48
    public function setSettleCoin(string $symbol): self
49
    {
50
        $this->settleCoin = $symbol;
51
        return $this;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getSettleCoin(): string
58
    {
59
        return $this->settleCoin;
60
    }
61
}