@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function testBuildResponseData() |
| 16 | 16 | { |
| 17 | - $json = '{"retCode":0,"retMsg":"OK","result":{"id":"2087","ltCode":"DOT3LUSDT","orderAmount":"","orderQuantity":"50","orderStatus":"2","quantity":"","serialNo":"r001","timestamp":1662605726326,"valueCoin":"DOT3L"},"retExtInfo":{},"time":1662605727987}';; |
|
| 17 | + $json = '{"retCode":0,"retMsg":"OK","result":{"id":"2087","ltCode":"DOT3LUSDT","orderAmount":"","orderQuantity":"50","orderStatus":"2","quantity":"","serialNo":"r001","timestamp":1662605726326,"valueCoin":"DOT3L"},"retExtInfo":{},"time":1662605727987}'; ; |
|
| 18 | 18 | $data = (new CurlResponseHandler())->build(json_decode($json, true), ReedemResponse::class); |
| 19 | 19 | |
| 20 | 20 | $this->assertEquals(0, $data->getReturnCode()); |
@@ -76,16 +76,16 @@ |
||
| 76 | 76 | |
| 77 | 77 | public function __construct(array $data) |
| 78 | 78 | { |
| 79 | - $this->amount = (float) $data['amount']; |
|
| 80 | - $this->execTime = DateTimeHelper::makeFromTimestamp((int) $data['excTime']); |
|
| 81 | - $this->fee = (float) $data['fee']; |
|
| 79 | + $this->amount = (float)$data['amount']; |
|
| 80 | + $this->execTime = DateTimeHelper::makeFromTimestamp((int)$data['excTime']); |
|
| 81 | + $this->fee = (float)$data['fee']; |
|
| 82 | 82 | $this->ltCode = $data['ltCode']; |
| 83 | 83 | $this->orderId = $data['orderId']; |
| 84 | 84 | $this->orderStatus = $data['orderStatus']; |
| 85 | - $this->orderTime = DateTimeHelper::makeFromTimestamp((int) $data['orderTime']); |
|
| 85 | + $this->orderTime = DateTimeHelper::makeFromTimestamp((int)$data['orderTime']); |
|
| 86 | 86 | $this->orderType = $data['orderType']; |
| 87 | 87 | $this->serialNo = $data['serialNo']; |
| 88 | - $this->value = (float) $data['value']; |
|
| 88 | + $this->value = (float)$data['value']; |
|
| 89 | 89 | $this->valueCoin = $data['valueCoin']; |
| 90 | 90 | } |
| 91 | 91 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $list = new EntityCollection(); |
| 17 | 17 | |
| 18 | 18 | if (!empty($data['list'])) { |
| 19 | - array_map(function ($item) use ($list) { |
|
| 19 | + array_map(function($item) use ($list) { |
|
| 20 | 20 | $list->push(ResponseDtoBuilder::make(PurchaseRedeemHistoryResponseItem::class, $item)); |
| 21 | 21 | }, $data['list']); |
| 22 | 22 | } |
@@ -65,10 +65,10 @@ |
||
| 65 | 65 | { |
| 66 | 66 | $this->timestamp = DateTimeHelper::makeFromTimestamp($data['timestamp']); |
| 67 | 67 | $this->id = $data['id']; |
| 68 | - $this->amount = (float) $data['amount']; |
|
| 68 | + $this->amount = (float)$data['amount']; |
|
| 69 | 69 | $this->ltCode = $data['ltCode']; |
| 70 | - $this->orderAmount = (float) $data['orderAmount']; |
|
| 71 | - $this->orderQuantity = (float) $data['orderQuantity']; |
|
| 70 | + $this->orderAmount = (float)$data['orderAmount']; |
|
| 71 | + $this->orderQuantity = (float)$data['orderQuantity']; |
|
| 72 | 72 | $this->orderStatus = $data['orderStatus']; |
| 73 | 73 | $this->serialNo = $data['serialNo']; |
| 74 | 74 | $this->valueCoin = $data['valueCoin']; |
@@ -45,10 +45,10 @@ |
||
| 45 | 45 | |
| 46 | 46 | public function __construct(array $data) |
| 47 | 47 | { |
| 48 | - $this->basket = (float) $data['basket']; |
|
| 49 | - $this->leverage = (float) $data['leverage']; |
|
| 50 | - $this->nav = (float) $data['nav']; |
|
| 51 | - $this->circulation = (float) $data['circulation']; |
|
| 48 | + $this->basket = (float)$data['basket']; |
|
| 49 | + $this->leverage = (float)$data['leverage']; |
|
| 50 | + $this->nav = (float)$data['nav']; |
|
| 51 | + $this->circulation = (float)$data['circulation']; |
|
| 52 | 52 | $this->navTime = DateTimeHelper::makeFromTimestamp($data['navTime']); |
| 53 | 53 | $this->ltCode = $data['ltCode']; |
| 54 | 54 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | $list = new EntityCollection(); |
| 19 | 19 | |
| 20 | 20 | if (!empty($data['list'])) { |
| 21 | - array_map(function ($item) use ($list) { |
|
| 21 | + array_map(function($item) use ($list) { |
|
| 22 | 22 | $list->push(ResponseDtoBuilder::make(AllAssetInfoResponseItem::class, $item)); |
| 23 | 23 | }, $data['list']); |
| 24 | 24 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $balance = new EntityCollection(); |
| 18 | 18 | |
| 19 | 19 | if (!empty($data['balances'])) { |
| 20 | - array_map(function ($item) use ($balance) { |
|
| 20 | + array_map(function($item) use ($balance) { |
|
| 21 | 21 | $balance->push(ResponseDtoBuilder::make(WalletBalanceResponseItem::class, $item)); |
| 22 | 22 | }, $data['balances']); |
| 23 | 23 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | $list = new EntityCollection(); |
| 17 | 17 | |
| 18 | 18 | if (!empty($data['list'])) { |
| 19 | - array_map(function ($item) use ($list) { |
|
| 19 | + array_map(function($item) use ($list) { |
|
| 20 | 20 | $list->push(ResponseDtoBuilder::make(PublicTradingRecordsResponseItem::class, $item)); |
| 21 | 21 | }, $data['list']); |
| 22 | 22 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function testBuildResponseData() |
| 16 | 16 | { |
| 17 | - $json = '{"retCode":0,"retMsg":"OK","result":{"symbol":"BTCUSDT","bidPrice":"26298.69","bidQty":"0.106418","askPrice":"26298.7","askQty":"0.008773","time":1683979447464},"retExtInfo":{},"time":1683979447820}';; |
|
| 17 | + $json = '{"retCode":0,"retMsg":"OK","result":{"symbol":"BTCUSDT","bidPrice":"26298.69","bidQty":"0.106418","askPrice":"26298.7","askQty":"0.008773","time":1683979447464},"retExtInfo":{},"time":1683979447820}'; ; |
|
| 18 | 18 | $data = (new CurlResponseHandler())->build(json_decode($json, true), BestBidAskPriceResponse::class); |
| 19 | 19 | |
| 20 | 20 | $this->assertEquals(0, $data->getReturnCode()); |