Passed
Push — master ( 8ca73d...2eaf19 )
by Vladislav
02:37 queued 15s
created

OrderBookChannel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getOperation() 0 3 1
A getResponseClassname() 0 3 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\WebSockets\Spot\PublicChannels\OrderBook;
4
5
use Carpenstar\ByBitAPI\Core\Enums\WebSocketOperationsEnum;
6
use Carpenstar\ByBitAPI\Core\Objects\WebSockets\WebSocketsSpotPublicChannel;
7
use Carpenstar\ByBitAPI\WebSockets\Spot\PublicChannels\OrderBook\Entities\OrderBookResponse;
8
9
/**
10
 * https://bybit-exchange.github.io/docs/spot/ws-public/orderbook
11
 *
12
 * Topic: orderbook.40.{symbol}
13
 *
14
 * Market depth data for a trading pair:
15
 *
16
 * Snapshot depth: 40 each for asks and bids.
17
 * Events trigger order book version change:
18
 * order enters order book
19
 * order leaves order book
20
 * order quantity changes
21
 * order filled
22
 * Pushes snapshot data only
23
 * Push frequency: 100ms
24
 */
25
class OrderBookChannel extends WebSocketsSpotPublicChannel
26
{
27
    /**
28
     * @return string
29
     */
30
    public function getResponseClassname(): string
31
    {
32
        return OrderBookResponse::class;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getOperation(): string
39
    {
40
        return WebSocketOperationsEnum::SUBSCRIBE;
41
    }
42
}
43