Passed
Pull Request — master (#31)
by Vladislav
07:58
created

WebSocketArgument   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSymbols() 0 3 1
A getStreamType() 0 3 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Core\Objects\WebSockets;
4
5
use Carpenstar\ByBitAPI\Core\Interfaces\IWebSocketArgumentInterface;
6
7
abstract class WebSocketArgument implements IWebSocketArgumentInterface
8
{
9
    public const STREAM_TYPES = ['spot', 'linear', 'option', 'inverse'];
10
    protected string $streamType;
11
    protected array $symbols;
12
13
    public function __construct(array $symbols, string $streamType)
14
    {
15
        $this->symbols = $symbols;
16
        $this->streamType = $streamType;
17
    }
18
19
    /**
20
     * Получение списка торговых символов
21
     *
22
     * @return array
23
     */
24
    public function getSymbols(): array
25
    {
26
        return $this->symbols;
27
    }
28
29
    /**
30
     * Получение алиаса потока
31
     *
32
     * @return string
33
     */
34
    public function getStreamType(): string
35
    {
36
        return $this->streamType;
37
    }
38
}
39