Passed
Push — master ( 420501...55c755 )
by Vladislav
04:26 queued 02:03
created

OrderBookRequest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 14
dl 0
loc 74
rs 10
c 0
b 0
f 0
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getSymbol() 0 3 1
A getCategory() 0 3 1
A setCategory() 0 4 1
A setLimit() 0 4 1
A getLimit() 0 3 1
A __construct() 0 3 1
A setSymbol() 0 4 1
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\MarketData\OrderBook\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
6
class OrderBookRequest extends AbstractParameters
7
{
8
    /**
9
     * @var string $category
10
     */
11
    protected string $category = "linear";
12
13
    /**
14
     * @var string $symbol
15
     */
16
    protected string $symbol;
17
18
    /**
19
     * @var int $limit
20
     */
21
    protected int $limit = 25;
22
23
    public function __construct()
24
    {
25
        $this->setRequiredField("symbol");
26
    }
27
28
    /**
29
     * @param string $category
30
     * @return OrderBookRequest
31
     */
32
    public function setCategory(string $category): self
0 ignored issues
show
Unused Code introduced by
The parameter $category is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

32
    public function setCategory(/** @scrutinizer ignore-unused */ string $category): self

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
33
    {
34
        $this->category = "linear"; // only linear support, now
35
        return $this;
36
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getCategory(): string
42
    {
43
        return $this->category;
44
    }
45
46
    /**
47
     * @param string $symbol
48
     * @return OrderBookRequest
49
     */
50
    public function setSymbol(string $symbol): self
51
    {
52
        $this->symbol = $symbol;
53
        return $this;
54
    }
55
56
    /**
57
     * @return string
58
     */
59
    public function getSymbol(): string
60
    {
61
        return $this->symbol;
62
    }
63
64
    /**
65
     * @param int $limit
66
     * @return OrderBookRequest
67
     */
68
    public function setLimit(int $limit): self
69
    {
70
        $this->limit = $limit;
71
        return $this;
72
    }
73
74
    /**
75
     * @return int
76
     */
77
    public function getLimit(): int
78
    {
79
        return $this->limit;
80
    }
81
}