OHLCDataModel::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 9
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 8
nc 1
nop 8
dl 0
loc 10
ccs 9
cts 9
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
namespace HanischIt\KrakenApi\Call\OHLCData\Model;
4
5
/**
6
 * Class OHLCDataModel
7
 * @package HanischIt\KrakenApi\Call\OHLCData\Model
8
 */
9
class OHLCDataModel
10
{
11
    /**
12
     * @var int
13
     */
14
    private $time;
15
    /**
16
     * @var float
17
     */
18
    private $open;
19
    /**
20
     * @var float
21
     */
22
    private $high;
23
    /**
24
     * @var float
25
     */
26
    private $low;
27
    /**
28
     * @var float
29
     */
30
    private $close;
31
    /**
32
     * @var float
33
     */
34
    private $vwap;
35
    /**
36
     * @var float
37
     */
38
    private $volume;
39
    /**
40
     * @var int
41
     */
42
    private $count;
43
44
    /**
45
     * OHLCDataModel constructor.
46
     * @param int $time
47
     * @param float $open
48
     * @param float $high
49
     * @param float $low
50
     * @param float $close
51
     * @param float $vwap
52
     * @param float $volume
53
     * @param int $count
54
     */
55 1
    public function __construct($time, $open, $high, $low, $close, $vwap, $volume, $count)
56
    {
57 1
        $this->time = $time;
58 1
        $this->open = $open;
59 1
        $this->high = $high;
60 1
        $this->low = $low;
61 1
        $this->close = $close;
62 1
        $this->vwap = $vwap;
63 1
        $this->volume = $volume;
64 1
        $this->count = $count;
65 1
    }
66
67
    /**
68
     * @return int
69
     */
70 1
    public function getTime()
71
    {
72 1
        return $this->time;
73
    }
74
75
    /**
76
     * @return float
77
     */
78 1
    public function getOpen()
79
    {
80 1
        return $this->open;
81
    }
82
83
    /**
84
     * @return float
85
     */
86 1
    public function getHigh()
87
    {
88 1
        return $this->high;
89
    }
90
91
    /**
92
     * @return float
93
     */
94 1
    public function getLow()
95
    {
96 1
        return $this->low;
97
    }
98
99
    /**
100
     * @return float
101
     */
102 1
    public function getClose()
103
    {
104 1
        return $this->close;
105
    }
106
107
    /**
108
     * @return float
109
     */
110 1
    public function getVwap()
111
    {
112 1
        return $this->vwap;
113
    }
114
115
    /**
116
     * @return float
117
     */
118 1
    public function getVolume()
119
    {
120 1
        return $this->volume;
121
    }
122
123
    /**
124
     * @return int
125
     */
126 1
    public function getCount()
127
    {
128 1
        return $this->count;
129
    }
130
}
131