Passed
Push — master ( 80a2af...b754d5 )
by Fabian
51s
created

LedgersInfoRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 6
dl 0
loc 14
ccs 7
cts 7
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace HanischIt\KrakenApi\Call\LedgersInfo;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\RequestInterface;
7
8
/**
9
 * Class LedgersInfoRequest
10
 * @package HanischIt\KrakenApi\Call\LedgersInfo
11
 */
12
class LedgersInfoRequest implements RequestInterface
13
{
14
15
    /**
16
     * @var string
17
     */
18
    private $aclass;
19
    /**
20
     * @var string
21
     */
22
    private $asset;
23
    /**
24
     * @var string
25
     */
26
    private $type;
27
    /**
28
     * @var string
29
     */
30
    private $start;
31
    /**
32
     * @var string
33
     */
34
    private $end;
35
    /**
36
     * @var string
37
     */
38
    private $ofs;
39
40
    /**
41
     * LedgersInfoRequest constructor.
42
     * @param string $aclass
43
     * @param string $asset
44
     * @param string $type
45
     * @param string $start
46
     * @param string $end
47
     * @param string $ofs
48
     */
49 2
    public function __construct(
50
        $aclass = 'currency',
51
        $asset = 'all',
52
        $type = 'all',
53
        $start = null,
54
        $end = null,
55
        $ofs = null
56
    ) {
57 2
        $this->aclass = $aclass;
58 2
        $this->asset = $asset;
59 2
        $this->type = $type;
60 2
        $this->start = $start;
61 2
        $this->end = $end;
62 2
        $this->ofs = $ofs;
63 2
    }
64
65
66
    /**
67
     * Returns the api request name
68
     *
69
     * @return string
70
     */
71 1
    public function getMethod()
72
    {
73 1
        return 'Ledgers';
74
    }
75
76
    /**
77
     * @return string
78
     */
79 1
    public function getVisibility()
80
    {
81 1
        return VisibilityEnum::VISIBILITY_PRIVATE;
82
    }
83
84
    /**
85
     * @return array
86
     */
87 1
    public function getRequestData()
88
    {
89 1
        $ret = [];
90 1
        $ret["aclass"] = $this->aclass;
91 1
        $ret["asset"] = $this->asset;
92 1
        $ret["type"] = $this->type;
93 1
        $ret["start"] = $this->start;
94 1
        $ret["end"] = $this->end;
95 1
        $ret["ofs"] = $this->ofs;
96 1
        return $ret;
97
    }
98
99
    /**
100
     * @return string
101
     */
102 1
    public function getResponseClassName()
103
    {
104 1
        return LedgersInfoResponse::class;
105
    }
106
}
107