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

OpenPositionModel::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 34
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 17
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 16
dl 0
loc 34
ccs 17
cts 17
cp 1
crap 1
rs 8.8571
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-28
5
 * @version 1.0.0
6
 */
7
8
namespace HanischIt\KrakenApi\Call\OpenPositions\Model;
9
10
/**
11
 * Class OpenPositionModel
12
 * @package HanischIt\KrakenApi\Call\OpenPositions\Model
13
 */
14
class OpenPositionModel
15
{
16
    /**
17
     * @var string
18
     */
19
    private $positiontxid;
20
    /**
21
     * @var string
22
     */
23
    private $ordertxid;
24
    /**
25
     * @var string
26
     */
27
    private $pair;
28
    /**
29
     * @var string
30
     */
31
    private $time;
32
    /**
33
     * @var string
34
     */
35
    private $type;
36
    /**
37
     * @var string
38
     */
39
    private $orderType;
40
    /**
41
     * @var float
42
     */
43
    private $cost;
44
    /**
45
     * @var float
46
     */
47
    private $fee;
48
    /**
49
     * @var float
50
     */
51
    private $vol;
52
    /**
53
     * @var float
54
     */
55
    private $volClosed;
56
    /**
57
     * @var float
58
     */
59
    private $margin;
60
    /**
61
     * @var float
62
     */
63
    private $value;
64
    /**
65
     * @var float
66
     */
67
    private $net;
68
    /**
69
     * @var string
70
     */
71
    private $misc;
72
    /**
73
     * @var string
74
     */
75
    private $oflags;
76
    /**
77
     * @var string
78
     */
79
    private $visqc;
80
81
    /**
82
     * OpenPositionModel constructor.
83
     * @param string $positiontxid
84
     * @param string $ordertxid
85
     * @param string $pair
86
     * @param string $time
87
     * @param string $type
88
     * @param string $orderType
89
     * @param float $cost
90
     * @param float $fee
91
     * @param float $vol
92
     * @param float $volClosed
93
     * @param float $margin
94
     * @param float $value
95
     * @param float $net
96
     * @param string $misc
97
     * @param string $oflags
98
     * @param string $visqc
99
     */
100 1
    public function __construct(
101
        $positiontxid,
102
        $ordertxid,
103
        $pair,
104
        $time,
105
        $type,
106
        $orderType,
107
        $cost,
108
        $fee,
109
        $vol,
110
        $volClosed,
111
        $margin,
112
        $value,
113
        $net,
114
        $misc,
115
        $oflags,
116
        $visqc
117
    ) {
118 1
        $this->ordertxid = $ordertxid;
119 1
        $this->pair = $pair;
120 1
        $this->time = $time;
121 1
        $this->type = $type;
122 1
        $this->orderType = $orderType;
123 1
        $this->cost = $cost;
124 1
        $this->fee = $fee;
125 1
        $this->vol = $vol;
126 1
        $this->volClosed = $volClosed;
127 1
        $this->margin = $margin;
128 1
        $this->value = $value;
129 1
        $this->net = $net;
130 1
        $this->misc = $misc;
131 1
        $this->oflags = $oflags;
132 1
        $this->visqc = $visqc;
133 1
        $this->positiontxid = $positiontxid;
134 1
    }
135
136
    /**
137
     * @return string
138
     */
139 1
    public function getOrdertxid()
140
    {
141 1
        return $this->ordertxid;
142
    }
143
144
    /**
145
     * @return string
146
     */
147 1
    public function getPair()
148
    {
149 1
        return $this->pair;
150
    }
151
152
    /**
153
     * @return string
154
     */
155 1
    public function getTime()
156
    {
157 1
        return $this->time;
158
    }
159
160
    /**
161
     * @return string
162
     */
163 1
    public function getType()
164
    {
165 1
        return $this->type;
166
    }
167
168
    /**
169
     * @return string
170
     */
171 1
    public function getOrderType()
172
    {
173 1
        return $this->orderType;
174
    }
175
176
    /**
177
     * @return float
178
     */
179 1
    public function getCost()
180
    {
181 1
        return $this->cost;
182
    }
183
184
    /**
185
     * @return float
186
     */
187 1
    public function getFee()
188
    {
189 1
        return $this->fee;
190
    }
191
192
    /**
193
     * @return float
194
     */
195 1
    public function getVol()
196
    {
197 1
        return $this->vol;
198
    }
199
200
    /**
201
     * @return float
202
     */
203 1
    public function getVolClosed()
204
    {
205 1
        return $this->volClosed;
206
    }
207
208
    /**
209
     * @return float
210
     */
211 1
    public function getMargin()
212
    {
213 1
        return $this->margin;
214
    }
215
216
    /**
217
     * @return float
218
     */
219 1
    public function getValue()
220
    {
221 1
        return $this->value;
222
    }
223
224
    /**
225
     * @return float
226
     */
227 1
    public function getNet()
228
    {
229 1
        return $this->net;
230
    }
231
232
    /**
233
     * @return string
234
     */
235 1
    public function getMisc()
236
    {
237 1
        return $this->misc;
238
    }
239
240
    /**
241
     * @return string
242
     */
243 1
    public function getOflags()
244
    {
245 1
        return $this->oflags;
246
    }
247
248
    /**
249
     * @return string
250
     */
251 1
    public function getVisqc()
252
    {
253 1
        return $this->visqc;
254
    }
255
256
    /**
257
     * @return string
258
     */
259 1
    public function getPositiontxid()
260
    {
261 1
        return $this->positiontxid;
262
    }
263
264
265
}