正在显示
11 个修改的文件
包含
11 行增加
和
11 行删除
| @@ -64,7 +64,7 @@ class CmBroker | @@ -64,7 +64,7 @@ class CmBroker | ||
| 64 | public $uid; | 64 | public $uid; |
| 65 | 65 | ||
| 66 | 66 | ||
| 67 | - public function __construct($plat, ApiInfo $apiInfo, $wsHost = null, $restHost = null) | 67 | + public function __construct($plat, ?ApiInfo $apiInfo, $wsHost = null, $restHost = null) |
| 68 | { | 68 | { |
| 69 | $this->plat = $plat; | 69 | $this->plat = $plat; |
| 70 | $exBroker = null; | 70 | $exBroker = null; |
| @@ -13,7 +13,7 @@ class Api | @@ -13,7 +13,7 @@ class Api | ||
| 13 | { | 13 | { |
| 14 | private $host = 'https://fapi.binance.com'; | 14 | private $host = 'https://fapi.binance.com'; |
| 15 | private ApiInfo $apiInfo; | 15 | private ApiInfo $apiInfo; |
| 16 | - public function __construct(ApiInfo $apiInfo) | 16 | + public function __construct(?ApiInfo $apiInfo) |
| 17 | { | 17 | { |
| 18 | $this->apiInfo = $apiInfo; | 18 | $this->apiInfo = $apiInfo; |
| 19 | } | 19 | } |
| @@ -21,7 +21,7 @@ class ExBroker | @@ -21,7 +21,7 @@ class ExBroker | ||
| 21 | private ?Websocket $wsAcc; | 21 | private ?Websocket $wsAcc; |
| 22 | private ?Websocket $wsKline; | 22 | private ?Websocket $wsKline; |
| 23 | 23 | ||
| 24 | - public function __construct(ApiInfo $apiInfo) | 24 | + public function __construct(?ApiInfo $apiInfo) |
| 25 | { | 25 | { |
| 26 | $this->apiInfo = $apiInfo; | 26 | $this->apiInfo = $apiInfo; |
| 27 | $this->api = new BnApi($apiInfo); | 27 | $this->api = new BnApi($apiInfo); |
| @@ -15,7 +15,7 @@ class Api | @@ -15,7 +15,7 @@ class Api | ||
| 15 | private $host = 'https://api.bitget.com'; | 15 | private $host = 'https://api.bitget.com'; |
| 16 | private ApiInfo $apiInfo; | 16 | private ApiInfo $apiInfo; |
| 17 | 17 | ||
| 18 | - public function __construct(ApiInfo $apiInfo) | 18 | + public function __construct(?ApiInfo $apiInfo) |
| 19 | { | 19 | { |
| 20 | $this->apiInfo = $apiInfo; | 20 | $this->apiInfo = $apiInfo; |
| 21 | } | 21 | } |
| @@ -25,7 +25,7 @@ class ExBroker | @@ -25,7 +25,7 @@ class ExBroker | ||
| 25 | private $timerAccPing = 0; | 25 | private $timerAccPing = 0; |
| 26 | private $timerKlinePing = 0; | 26 | private $timerKlinePing = 0; |
| 27 | 27 | ||
| 28 | - public function __construct(ApiInfo $apiInfo) | 28 | + public function __construct(?ApiInfo $apiInfo) |
| 29 | { | 29 | { |
| 30 | $this->apiInfo = $apiInfo; | 30 | $this->apiInfo = $apiInfo; |
| 31 | $this->api = new BgApi($apiInfo); | 31 | $this->api = new BgApi($apiInfo); |
| @@ -15,7 +15,7 @@ class Api | @@ -15,7 +15,7 @@ class Api | ||
| 15 | private $host = 'https://api.bybit.com'; | 15 | private $host = 'https://api.bybit.com'; |
| 16 | private ApiInfo $apiInfo; | 16 | private ApiInfo $apiInfo; |
| 17 | 17 | ||
| 18 | - public function __construct(ApiInfo $apiInfo) | 18 | + public function __construct(?ApiInfo $apiInfo) |
| 19 | { | 19 | { |
| 20 | $this->apiInfo = $apiInfo; | 20 | $this->apiInfo = $apiInfo; |
| 21 | } | 21 | } |
| @@ -25,7 +25,7 @@ class ExBroker | @@ -25,7 +25,7 @@ class ExBroker | ||
| 25 | private $timerAccPing = 0; | 25 | private $timerAccPing = 0; |
| 26 | private $timerKlinePing = 0; | 26 | private $timerKlinePing = 0; |
| 27 | 27 | ||
| 28 | - public function __construct(ApiInfo $apiInfo) | 28 | + public function __construct(?ApiInfo $apiInfo) |
| 29 | { | 29 | { |
| 30 | $this->apiInfo = $apiInfo; | 30 | $this->apiInfo = $apiInfo; |
| 31 | $this->api = new BbApi($apiInfo); | 31 | $this->api = new BbApi($apiInfo); |
| @@ -13,7 +13,7 @@ class Api | @@ -13,7 +13,7 @@ class Api | ||
| 13 | { | 13 | { |
| 14 | private $host = 'https://api.bybit.com'; | 14 | private $host = 'https://api.bybit.com'; |
| 15 | private ApiInfo $apiInfo; | 15 | private ApiInfo $apiInfo; |
| 16 | - public function __construct(ApiInfo $apiInfo) | 16 | + public function __construct(?ApiInfo $apiInfo) |
| 17 | { | 17 | { |
| 18 | $this->apiInfo = $apiInfo; | 18 | $this->apiInfo = $apiInfo; |
| 19 | } | 19 | } |
| @@ -22,7 +22,7 @@ class ExBroker | @@ -22,7 +22,7 @@ class ExBroker | ||
| 22 | private ?Websocket $wsAcc; | 22 | private ?Websocket $wsAcc; |
| 23 | private ?Websocket $wsKline; | 23 | private ?Websocket $wsKline; |
| 24 | 24 | ||
| 25 | - public function __construct(ApiInfo $apiInfo) | 25 | + public function __construct(?ApiInfo $apiInfo) |
| 26 | { | 26 | { |
| 27 | $this->apiInfo = $apiInfo; | 27 | $this->apiInfo = $apiInfo; |
| 28 | $this->api = new BbApi($apiInfo); | 28 | $this->api = new BbApi($apiInfo); |
| @@ -16,7 +16,7 @@ class Api | @@ -16,7 +16,7 @@ class Api | ||
| 16 | private ?ApiInfo $apiInfo = null; | 16 | private ?ApiInfo $apiInfo = null; |
| 17 | private string $host = "https://www.okx.com"; | 17 | private string $host = "https://www.okx.com"; |
| 18 | 18 | ||
| 19 | - public function __construct($apiInfo = null, $host = "") | 19 | + public function __construct(?ApiInfo $apiInfo = null, $host = "") |
| 20 | { | 20 | { |
| 21 | if ($apiInfo != null) { | 21 | if ($apiInfo != null) { |
| 22 | $this->apiInfo = $apiInfo; | 22 | $this->apiInfo = $apiInfo; |
| @@ -26,7 +26,7 @@ class ExBroker | @@ -26,7 +26,7 @@ class ExBroker | ||
| 26 | private $timerAccPing = 0; | 26 | private $timerAccPing = 0; |
| 27 | private $timerKlinePing = 0; | 27 | private $timerKlinePing = 0; |
| 28 | 28 | ||
| 29 | - public function __construct($apiInfo) | 29 | + public function __construct(?ApiInfo $apiInfo) |
| 30 | { | 30 | { |
| 31 | $this->apiInfo = $apiInfo; | 31 | $this->apiInfo = $apiInfo; |
| 32 | $this->api = new OkxApi($apiInfo); | 32 | $this->api = new OkxApi($apiInfo); |
-
请 注册 或 登录 后发表评论