Test Failed
Pull Request — master (#3)
by Vladislav
02:16
created

OrderBookPriceItemResponse::getPrice()   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\OrderBook\Response;
3
4
use Carpenstar\ByBitAPI\Core\Objects\ResponseEntity;
5
use Carpenstar\ByBitAPI\Spot\MarketData\OrderBook\Interfaces\IOrderBookPriceResponse;
6
7
class OrderBookPriceItemResponse extends ResponseEntity implements IOrderBookPriceResponse
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
    /**
23
     * @param array $data
24
     */
25
    public function __construct(array $data)
26
    {
27
        $this
28
            ->setPrice($data[0])
29
            ->setQuantity($data[1]);
30
    }
31
32
    /**
33
     * @param float $price
34
     * @return $this
35
     */
36
    private function setPrice(float $price): self
37
    {
38
        $this->price = $price;
39
        return $this;
40
    }
41
42
    /**
43
     * @return float
44
     */
45
    public function getPrice(): float
46
    {
47
        return $this->price;
48
    }
49
50
    /**
51
     * @param float $quantity
52
     * @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...
53
     */
54
    private function setQuantity(float $quantity): self
55
    {
56
        $this->quantity = $quantity;
57
        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...
58
    }
59
60
    /**
61
     * @return float
62
     */
63
    public function getQuantity(): float
64
    {
65
        return $this->quantity;
66
    }
67
}