Passed
Push — master ( 3894cc...b6588e )
by Vladislav
06:30 queued 04:28
created

WebSocketConnectionResponse::getConnectionId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
namespace Carpenstar\ByBitAPI\Core\Objects\WebSockets\Entity;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
5
6
class WebSocketConnectionResponse extends AbstractResponse
7
{
8
    private bool $success;
9
    private ?string $returnMessage;
10
    private string $connectionId;
11
    private ?string $reqId;
12
    private string $operation;
13
14
    public function __construct(array $data)
15
    {
16
        $this->success = $data['success'];
17
        $this->returnMessage = $data['retm_msg'] ?? null;
18
        $this->connectionId = $data['conn_id'];
19
        $this->reqId = $data['req_id'] ?? null;
20
        $this->operation = $data['op'];
21
    }
22
23
    public function isSuccess(): bool
24
    {
25
        return $this->success;
26
    }
27
28
    public function getReturnMessage(): ?string
29
    {
30
        return $this->returnMessage;
31
    }
32
33
    public function getConnectionId(): string
34
    {
35
        return $this->connectionId;
36
    }
37
38
    public function getReqId(): ?string 
39
    {
40
        return $this->reqId;
41
    }
42
43
    public function getOperation(): string
44
    {
45
        return $this->operation;
46
    }
47
}
48