Passed
Push — master ( faa4ac...572ea2 )
by Vladislav
06:35 queued 04:06
created

PurchaseRequest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 79
rs 10
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getLtAmount() 0 3 1
A getSerialNo() 0 3 1
A setSerialNo() 0 4 1
A setLtAmount() 0 4 1
A __construct() 0 5 1
A getLtCode() 0 3 1
A setLtCode() 0 4 1
1
<?php
2
namespace Carpenstar\ByBitAPI\Spot\LeverageToken\Purchase\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
use Carpenstar\ByBitAPI\Spot\LeverageToken\Purchase\Interfaces\IPurchaseRequestInterface;
6
use Carpenstar\ByBitAPI\Spot\LeverageToken\Purchase\Purchase;
7
8
class PurchaseRequest extends AbstractParameters implements IPurchaseRequestInterface
9
{
10
    /**
11
     * Abbreviation of the LT.
12
     * @var string $ltCode
13
     */
14
    protected string $ltCode;
15
16
    /**
17
     * Purchase amount
18
     * @var float $ltAmount
19
     */
20
    protected float $ltAmount;
21
22
    /**
23
     * Serial number. A kind of unique customised ID
24
     * @var string $serialNo
25
     */
26
    protected string $serialNo;
27
28
    public function __construct()
29
    {
30
        $this
31
            ->setRequiredField('ltCode')
32
            ->setRequiredField('ltAmount');
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getLtCode(): string
39
    {
40
        return $this->ltCode;
41
    }
42
43
    /**
44
     * @param string $ltCode
45
     * @return Purchase
46
     */
47
    public function setLtCode(string $ltCode): self
48
    {
49
        $this->ltCode = $ltCode;
50
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Carpenstar\ByBitAPI\Spot...Request\PurchaseRequest which is incompatible with the documented return type Carpenstar\ByBitAPI\Spot...Token\Purchase\Purchase.
Loading history...
51
    }
52
53
    /**
54
     * @return float
55
     */
56
    public function getLtAmount(): float
57
    {
58
        return $this->ltAmount;
59
    }
60
61
    /**
62
     * @param float $ltAmount
63
     * @return Purchase
64
     */
65
    public function setLtAmount(float $ltAmount): self
66
    {
67
        $this->ltAmount = $ltAmount;
68
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Carpenstar\ByBitAPI\Spot...Request\PurchaseRequest which is incompatible with the documented return type Carpenstar\ByBitAPI\Spot...Token\Purchase\Purchase.
Loading history...
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getSerialNo(): string
75
    {
76
        return $this->serialNo;
77
    }
78
79
    /**
80
     * @param string $serialNo
81
     * @return Purchase
82
     */
83
    public function setSerialNo(string $serialNo): self
84
    {
85
        $this->serialNo = $serialNo;
86
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Carpenstar\ByBitAPI\Spot...Request\PurchaseRequest which is incompatible with the documented return type Carpenstar\ByBitAPI\Spot...Token\Purchase\Purchase.
Loading history...
87
    }
88
}