Completed
Push — master ( 3ad417...37b5d9 )
by Fabian
02:10
created

TradeBalanceAbstractRequest   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 62
ccs 19
cts 19
cp 1
rs 10
c 0
b 0
f 0
wmc 7

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getVisibility() 0 3 1
A getResponseClassName() 0 3 1
A getRequestData() 0 10 3
A getMethod() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace HanischIt\KrakenApi\Model\TradeBalance;
4
5
use HanischIt\KrakenApi\Enum\VisibilityEnum;
6
use HanischIt\KrakenApi\Model\AbstractRequest;
7
8
/**
9
 * Class ServerTimeAbstractRequest
10
 *
11
 * @package HanischIt\KrakenApi\Model\ServerTime
12
 */
13
class TradeBalanceAbstractRequest extends AbstractRequest
14
{
15
    /**
16
     * @var string
17
     */
18
    private $aclass;
19
    /**
20
     * @var string
21
     */
22
    private $asset;
23
24
    /**
25
     * TradeBalanceAbstractRequest constructor.
26
     * @param string $aclass
27
     * @param string $asset
28
     */
29 2
    public function __construct($aclass, $asset)
30
    {
31 2
        $this->aclass = $aclass;
32 2
        $this->asset = $asset;
33 2
    }
34
35
36
    /**
37
     * Returns the api request name
38
     *
39
     * @return string
40
     */
41 1
    public function getMethod()
42
    {
43 1
        return 'TradeBalance';
44
    }
45
46
    /**
47
     * @return string
48
     */
49 1
    public function getVisibility()
50
    {
51 1
        return VisibilityEnum::VISIBILITY_PRIVATE;
52
    }
53
54
    /**
55
     * @return array
56
     */
57 1
    public function getRequestData()
58
    {
59 1
        $ret = [];
60 1
        if (null !== $this->aclass) {
61 1
            $ret["aclass"] = $this->aclass;
62 1
        }
63 1
        if (null !== $this->asset) {
64 1
            $ret["asset"] = $this->asset;
65 1
        }
66 1
        return $ret;
67
    }
68
69
    /**
70
     * @return string
71
     */
72 1
    public function getResponseClassName()
73
    {
74 1
        return TradeBalanceResponse::class;
75
    }
76
}
77