Passed
Push — master ( 7a134a...be08d2 )
by Vladislav
02:35 queued 13s
created

MergedOrderBookPriceItemResponse::getQuantity()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
namespace Carpenstar\ByBitAPI\Spot\MarketData\MergedOrderBook\Response;
3
4
use Carpenstar\ByBitAPI\Core\Objects\ResponseEntity;
5
use Carpenstar\ByBitAPI\Spot\MarketData\MergedOrderBook\Interfaces\IMergedOrderBookPriceResponse;
6
7
class MergedOrderBookPriceItemResponse extends ResponseEntity implements IMergedOrderBookPriceResponse
8
{
9
    /**
10
     * Price position value
11
     * @var float
12
     */
13
    private float $price;
14
15
    /**
16
     * Quantity position value
17
     * @var float
18
     */
19
    private float $quantity;
20
21
    /**
22
     * @param array $data
23
     */
24
    public function __construct(array $data)
25
    {
26
        $this
27
            ->setPrice($data[0])
28
            ->setQuantity($data[1]);
29
    }
30
31
    /**
32
     * @param float $price
33
     * @return $this
34
     */
35
    private function setPrice(float $price): self
36
    {
37
        $this->price = $price;
38
        return $this;
39
    }
40
41
    /**
42
     * @return float
43
     */
44
    public function getPrice(): float
45
    {
46
        return $this->price;
47
    }
48
49
    /**
50
     * @param float $quantity
51
     * @return MergedOrderBookPriceItemResponse
52
     */
53
    private function setQuantity(float $quantity): self
54
    {
55
        $this->quantity = $quantity;
56
        return $this;
57
    }
58
59
    /**
60
     * @return float
61
     */
62
    public function getQuantity(): float
63
    {
64
        return $this->quantity;
65
    }
66
}