Completed
Push — master ( ddb885...bba056 )
by Fabian
02:59
created

OpenOrderModel::__construct()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 32
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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