| Total Complexity | 7 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class BoocktickerResponseItem extends AbstractResponse |
||
| 9 | { |
||
| 10 | private string $symbol; |
||
| 11 | private ?float $bestBidPrice; |
||
| 12 | private ?float $bidQuantity; |
||
| 13 | private ?float $bestAskPrice; |
||
| 14 | private ?float $askQuantity; |
||
| 15 | private \DateTime $responseTimestamp; |
||
| 16 | |||
| 17 | |||
| 18 | public function __construct(array $data) |
||
| 19 | { |
||
| 20 | $this->responseTimestamp = DateTimeHelper::makeFromTimestamp($data['t']); |
||
| 21 | $this->bestBidPrice = $data['bp'] ?? null; |
||
| 22 | $this->bidQuantity = $data['bq'] ?? null; |
||
| 23 | $this->bestAskPrice = $data['ap'] ?? null; |
||
| 24 | $this->askQuantity = $data['aq'] ?? null; |
||
| 25 | $this->symbol = $data['s']; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return \DateTime |
||
| 30 | */ |
||
| 31 | public function getResponseTimestamp(): \DateTime |
||
| 32 | { |
||
| 33 | return $this->responseTimestamp; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @return float |
||
| 38 | */ |
||
| 39 | public function getBestBidPrice(): float |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return float |
||
| 46 | */ |
||
| 47 | public function getBidQuantity(): float |
||
| 48 | { |
||
| 49 | return $this->bidQuantity; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @return float |
||
| 54 | */ |
||
| 55 | public function getBestAskPrice(): float |
||
| 56 | { |
||
| 57 | return $this->bestAskPrice; |
||
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @return float |
||
| 62 | */ |
||
| 63 | public function getAskQuantity(): float |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | public function getSymbol(): string |
||
| 74 | } |
||
| 75 | } |
||
| 76 |