| Total Complexity | 5 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 |
||
| 65 | } |
||
| 66 | } |