OrderBookPriceItemResponse   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
c 0
b 0
f 0
dl 0
loc 32
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getQuantity() 0 3 1
A __construct() 0 4 1
A getPrice() 0 3 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Derivatives\MarketData\OrderBook\Response;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Derivatives\MarketData\OrderBook\Interfaces\IOrderBookResponsePriceItemInterface;
7
8
class OrderBookPriceItemResponse extends AbstractResponse implements IOrderBookResponsePriceItemInterface
9
{
10
    /**
11
     * @var float $price
12
     */
13
    private float $price;
14
15
    /**
16
     * @var float $quantity
17
     */
18
    private float $quantity;
19
20
    public function __construct(array $data)
21
    {
22
        $this->price = $data[0];
23
        $this->quantity = $data[1];
24
    }
25
26
    /**
27
     * @return float
28
     */
29
    public function getPrice(): float
30
    {
31
        return $this->price;
32
    }
33
34
    /**
35
     * @return float
36
     */
37
    public function getQuantity(): float
38
    {
39
        return $this->quantity;
40
    }
41
}
42