Test Failed
Push — master ( e2e181...baee16 )
by Fabian
02:01
created

OrderModel::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 36
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 17
nc 1
nop 17
dl 0
loc 36
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   18.07.2017 20:32
5
 * @version 1.0
6
 */
7
8
namespace HanischIt\KrakenApi\Model\Model\Order;
9
10
11
/**
12
 * Class ClosedOrderModel
13
 *
14
 * @package HanischIt\KrakenApi\Model\ClosedOrders
15
 */
16
class OrderModel
17
{
18
    /**
19
     * @var string
20
     */
21
    private $txId;
22
    /**
23
     * @var float
24
     */
25
    private $cost;
26
    /**
27
     * @var OrderTypeModel
28
     */
29
    private $orderDetails;
30
    /**
31
     * @var int
32
     */
33
    private $expiretm;
34
    /**
35
     * @var float
36
     */
37
    private $fee;
38
    /**
39
     * @var string
40
     */
41
    private $misc;
42
    /**
43
     * @var string
44
     */
45
    private $oflags;
46
    /**
47
     * @var int
48
     */
49
    private $opentm;
50
    /**
51
     * @var float
52
     */
53
    private $price;
54
    /**
55
     * @var string
56
     */
57
    private $refid;
58
    /**
59
     * @var int
60
     */
61
    private $starttm;
62
    /**
63
     * @var string
64
     */
65
    private $status;
66
    /**
67
     * @var string
68
     */
69
    private $userref;
70
    /**
71
     * @var float
72
     */
73
    private $vol;
74
    /**
75
     * @varfloat
76
     */
77
    private $vol_exec;
78
    private $closeTm;
79
    private $reason;
80
81
    /**
82
     * OpenOrderModel constructor.
83
     *
84
     * @param string                    $txid
85
     * @param string                    $closeTm
86
     * @param float                     $cost
87
     * @param OrderTypeModel $orderDetails
88
     * @param int                       $expiretm
89
     * @param float                     $fee
90
     * @param string                    $misc
91
     * @param string                    $oflags
92
     * @param int                       $opentm
93
     * @param float                     $price
94
     * @param string                    $reason
95
     * @param string                    $refid
96
     * @param int                       $starttm
97
     * @param string                    $status
98
     * @param string                    $userref
99
     * @param float                     $vol
100
     * @param float                     $vol_exec
101
     */
102
    public function __construct(
103
        $txid,
104
        $closeTm,
105
        $cost,
106
        OrderTypeModel $orderDetails,
107
        $expiretm,
108
        $fee,
109
        $misc,
110
        $oflags,
111
        $opentm,
112
        $price,
113
        $reason,
114
        $refid,
115
        $starttm,
116
        $status,
117
        $userref,
118
        $vol,
119
        $vol_exec
120
    ) {
121
        $this->txId = $txid;
122
        $this->cost = $cost;
123
        $this->orderDetails = $orderDetails;
124
        $this->expiretm = $expiretm;
125
        $this->fee = $fee;
126
        $this->misc = $misc;
127
        $this->oflags = $oflags;
128
        $this->opentm = $opentm;
129
        $this->price = $price;
130
        $this->refid = $refid;
131
        $this->starttm = $starttm;
132
        $this->status = $status;
133
        $this->userref = $userref;
134
        $this->vol = $vol;
135
        $this->vol_exec = $vol_exec;
136
        $this->closeTm = $closeTm;
137
        $this->reason = $reason;
138
    }
139
140
    /**
141
     * @return string
142
     */
143
    public function getTxId()
144
    {
145
        return $this->txId;
146
    }
147
148
149
    /**
150
     * @return mixed
151
     */
152
    public function getCost()
153
    {
154
        return $this->cost;
155
    }
156
157
    /**
158
     * @return OrderTypeModel
159
     */
160
    public function getOrderDetails()
161
    {
162
        return $this->orderDetails;
163
    }
164
165
    /**
166
     * @return int
167
     */
168
    public function getExpiretm()
169
    {
170
        return $this->expiretm;
171
    }
172
173
    /**
174
     * @return float
175
     */
176
    public function getFee()
177
    {
178
        return $this->fee;
179
    }
180
181
    /**
182
     * @return string
183
     */
184
    public function getMisc()
185
    {
186
        return $this->misc;
187
    }
188
189
    /**
190
     * @return string
191
     */
192
    public function getOflags()
193
    {
194
        return $this->oflags;
195
    }
196
197
    /**
198
     * @return int
199
     */
200
    public function getOpentm()
201
    {
202
        return $this->opentm;
203
    }
204
205
    /**
206
     * @return float
207
     */
208
    public function getPrice()
209
    {
210
        return $this->price;
211
    }
212
213
    /**
214
     * @return string
215
     */
216
    public function getRefid()
217
    {
218
        return $this->refid;
219
    }
220
221
    /**
222
     * @return int
223
     */
224
    public function getStarttm()
225
    {
226
        return $this->starttm;
227
    }
228
229
    /**
230
     * @return string
231
     */
232
    public function getStatus()
233
    {
234
        return $this->status;
235
    }
236
237
    /**
238
     * @return string
239
     */
240
    public function getUserref()
241
    {
242
        return $this->userref;
243
    }
244
245
    /**
246
     * @return float
247
     */
248
    public function getVol()
249
    {
250
        return $this->vol;
251
    }
252
253
    /**
254
     * @return mixed
255
     */
256
    public function getVolExec()
257
    {
258
        return $this->vol_exec;
259
    }
260
261
    /**
262
     * @return string
263
     */
264
    public function getCloseTm()
265
    {
266
        return $this->closeTm;
267
    }
268
269
    /**
270
     * @return string
271
     */
272
    public function getReason()
273
    {
274
        return $this->reason;
275
    }
276
}
277