OrderBookPriceItemResponse::getQuantity()   A
last analyzed

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
3
namespace Carpenstar\ByBitAPI\Spot\MarketData\OrderBook\Response;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Spot\MarketData\OrderBook\Interfaces\IOrderBookPriceResponseInterface;
7
8
class OrderBookPriceItemResponse extends AbstractResponse implements IOrderBookPriceResponseInterface
9
{
10
    /**
11
     * Price position value
12
     * @var float
13
     */
14
    private float $price;
15
16
    /**
17
     * Quantity position value
18
     * @var float
19
     */
20
    private float $quantity;
21
22
23
    /**
24
     * @param array $data
25
     */
26
    public function __construct(array $data)
27
    {
28
        $this
29
            ->setPrice($data[0])
30
            ->setQuantity($data[1]);
31
    }
32
33
    /**
34
     * @param float $price
35
     * @return $this
36
     */
37
    private function setPrice(float $price): self
38
    {
39
        $this->price = $price;
40
        return $this;
41
    }
42
43
    /**
44
     * @return float
45
     */
46
    public function getPrice(): float
47
    {
48
        return $this->price;
49
    }
50
51
    /**
52
     * @param float $quantity
53
     * @return MergedOrderBookResponseItem
0 ignored issues
show
Bug introduced by
The type Carpenstar\ByBitAPI\Spot...edOrderBookResponseItem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
54
     */
55
    private function setQuantity(float $quantity): self
56
    {
57
        $this->quantity = $quantity;
58
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Carpenstar\ByBitAPI\Spot...erBookPriceItemResponse which is incompatible with the documented return type Carpenstar\ByBitAPI\Spot...edOrderBookResponseItem.
Loading history...
59
    }
60
61
    /**
62
     * @return float
63
     */
64
    public function getQuantity(): float
65
    {
66
        return $this->quantity;
67
    }
68
}
69