PlaceOrderResponse   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
c 2
b 0
f 0
dl 0
loc 53
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setOrderLinkId() 0 4 1
A setOrderId() 0 4 1
A getOrderId() 0 3 1
A getOrderLinkId() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Order\PlaceOrder\Response;
4
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Derivatives\Contract\Order\PlaceOrder\Interfaces\IPlaceOrderResponseInterface;
7
8
class PlaceOrderResponse extends AbstractResponse implements IPlaceOrderResponseInterface
9
{
10
    /**
11
     * @var string $orderId
12
     */
13
    private string $orderId;
14
15
    /**
16
     * @var string $orderLinkId
17
     */
18
    private string $orderLinkId;
19
20
    public function __construct(array $data)
21
    {
22
        $this
23
            ->setOrderId($data['orderId'])
24
            ->setOrderLinkId($data['orderLinkId']);
25
    }
26
27
    /**
28
     * @param string $orderId
29
     * @return self
30
     */
31
    private function setOrderId(string $orderId): self
32
    {
33
        $this->orderId = $orderId;
34
        return $this;
35
    }
36
37
    /**
38
     * @return string|null
39
     */
40
    public function getOrderId(): ?string
41
    {
42
        return $this->orderId;
43
    }
44
45
    /**
46
     * @param string $orderLinkId
47
     * @return PlaceOrderResponse
48
     */
49
    private function setOrderLinkId(string $orderLinkId): self
50
    {
51
        $this->orderLinkId = $orderLinkId;
52
        return $this;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getOrderLinkId(): string
59
    {
60
        return $this->orderLinkId;
61
    }
62
}
63