Completed
Push — master ( 39a0bd...0a53a0 )
by Fabian
02:26
created

LedgerInfoModel::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 9
nc 1
nop 9
dl 0
loc 11
ccs 10
cts 10
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
/**
3
 * @author Fabian Hanisch
4
 * @since: 2017-08-27
5
 * @version 1.0.0
6
 */
7
8
namespace HanischIt\KrakenApi\Call\Shared\Model;
9
10
/**
11
 * Class LedgerInfoModel
12
 * @package HanischIt\KrakenApi\Call\Shared\Model
13
 */
14
class LedgerInfoModel
15
{
16
    /**
17
     * @var string
18
     */
19
    private $ledgerId;
20
    /**
21
     * @var string
22
     */
23
    private $refid;
24
    /**
25
     * @var string
26
     */
27
    private $time;
28
    /**
29
     * @var string
30
     */
31
    private $type;
32
    /**
33
     * @var string
34
     */
35
    private $aclass;
36
    /**
37
     * @var string
38
     */
39
    private $asset;
40
    /**
41
     * @var float
42
     */
43
    private $amount;
44
    /**
45
     * @var float
46
     */
47
    private $fee;
48
    /**
49
     * @var float
50
     */
51
    private $balance;
52
53
    /**
54
     * LedgerInfoModel constructor.
55
     * @param string $ledgerId
56
     * @param string $refid
57
     * @param string $time
58
     * @param string $type
59
     * @param string $aclass
60
     * @param string $asset
61
     * @param float $amount
62
     * @param float $fee
63
     * @param float $balance
64
     */
65 2
    public function __construct($ledgerId, $refid, $time, $type, $aclass, $asset, $amount, $fee, $balance)
66
    {
67 2
        $this->ledgerId = $ledgerId;
68 2
        $this->refid = $refid;
69 2
        $this->time = $time;
70 2
        $this->type = $type;
71 2
        $this->aclass = $aclass;
72 2
        $this->asset = $asset;
73 2
        $this->amount = $amount;
74 2
        $this->fee = $fee;
75 2
        $this->balance = $balance;
76 2
    }
77
78
    /**
79
     * @return string
80
     */
81 2
    public function getLedgerId()
82
    {
83 2
        return $this->ledgerId;
84
    }
85
86
    /**
87
     * @return string
88
     */
89 2
    public function getRefid()
90
    {
91 2
        return $this->refid;
92
    }
93
94
    /**
95
     * @return string
96
     */
97 2
    public function getTime()
98
    {
99 2
        return $this->time;
100
    }
101
102
    /**
103
     * @return string
104
     */
105 2
    public function getType()
106
    {
107 2
        return $this->type;
108
    }
109
110
    /**
111
     * @return string
112
     */
113 2
    public function getAclass()
114
    {
115 2
        return $this->aclass;
116
    }
117
118
    /**
119
     * @return string
120
     */
121 2
    public function getAsset()
122
    {
123 2
        return $this->asset;
124
    }
125
126
    /**
127
     * @return float
128
     */
129 2
    public function getAmount()
130
    {
131 2
        return $this->amount;
132
    }
133
134
    /**
135
     * @return float
136
     */
137 2
    public function getFee()
138
    {
139 2
        return $this->fee;
140
    }
141
142
    /**
143
     * @return float
144
     */
145 2
    public function getBalance()
146
    {
147 2
        return $this->balance;
148
    }
149
150
151
}