| Total Complexity | 5 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | class OrderBookPriceItemResponse extends ResponseEntity |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * @var float $price |
||
| 10 | */ |
||
| 11 | private float $price; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var float $quantity |
||
| 15 | */ |
||
| 16 | private float $quantity; |
||
| 17 | |||
| 18 | public function __construct(array $data) |
||
| 19 | { |
||
| 20 | |||
| 21 | $this |
||
| 22 | ->setPrice($data[0]) |
||
| 23 | ->setQuantity($data[1]); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param float $price |
||
| 28 | * @return self |
||
| 29 | */ |
||
| 30 | private function setPrice(float $price): self |
||
| 31 | { |
||
| 32 | $this->price = $price; |
||
| 33 | return $this; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return float |
||
| 38 | */ |
||
| 39 | public function getPrice(): float |
||
| 40 | { |
||
| 41 | return $this->price; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param float $quantity |
||
| 46 | * @return self |
||
| 47 | */ |
||
| 48 | private function setQuantity(float $quantity): self |
||
| 49 | { |
||
| 50 | $this->quantity = $quantity; |
||
| 51 | return $this; |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @return float |
||
| 56 | */ |
||
| 57 | public function getQuantity(): float |
||
| 60 | } |
||
| 61 | } |