CharacterProfileValueObject::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 29

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 29
ccs 0
cts 29
cp 0
rs 9.456
c 0
b 0
f 0
cc 1
nc 1
nop 13
crap 2

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 Kubinashi\BattlenetApi\WorldOfWarcraft\CharacterProfileApi\CharacterProfile\Model;
4
5
/**
6
 * @author  Willy Reiche
7
 * @since   2017-07-22
8
 * @version 1.0
9
 */
10
class CharacterProfileValueObject
11
{
12
    /**
13
     * @var string
14
     */
15
    private $lastModified;
16
17
    /**
18
     * @var string
19
     */
20
    private $name;
21
22
    /**
23
     * @var string
24
     */
25
    private $realm;
26
27
    /**
28
     * @var string
29
     */
30
    private $battleGroup;
31
32
    /**
33
     * @var string
34
     */
35
    private $class;
36
37
    /**
38
     * @var string
39
     */
40
    private $race;
41
42
    /**
43
     * @var string
44
     */
45
    private $gender;
46
47
    /**
48
     * @var string
49
     */
50
    private $level;
51
52
    /**
53
     * @var string
54
     */
55
    private $achievementPoints;
56
57
    /**
58
     * @var string
59
     */
60
    private $thumbnail;
61
62
    /**
63
     * @var string
64
     */
65
    private $calcClass;
66
67
    /**
68
     * @var string
69
     */
70
    private $faction;
71
72
    /**
73
     * @var string
74
     */
75
    private $totalHonorableKills;
76
77
    /**
78
     * CharacterProfileValueObject constructor.
79
     * @param string $lastModified
80
     * @param string $name
81
     * @param string $realm
82
     * @param string $battleGroup
83
     * @param string $class
84
     * @param string $race
85
     * @param string $gender
86
     * @param string $level
87
     * @param string $achievementPoints
88
     * @param string $thumbnail
89
     * @param string $calcClass
90
     * @param string $faction
91
     * @param string $totalHonorableKills
92
     */
93
    public function __construct(
94
        $lastModified,
95
        $name,
96
        $realm,
97
        $battleGroup,
98
        $class,
99
        $race,
100
        $gender,
101
        $level,
102
        $achievementPoints,
103
        $thumbnail,
104
        $calcClass,
105
        $faction,
106
        $totalHonorableKills
107
    ) {
108
        $this->lastModified = $lastModified;
109
        $this->name = $name;
110
        $this->realm = $realm;
111
        $this->battleGroup = $battleGroup;
112
        $this->class = $class;
113
        $this->race = $race;
114
        $this->gender = $gender;
115
        $this->level = $level;
116
        $this->achievementPoints = $achievementPoints;
117
        $this->thumbnail = $thumbnail;
118
        $this->calcClass = $calcClass;
119
        $this->faction = $faction;
120
        $this->totalHonorableKills = $totalHonorableKills;
121
    }
122
123
    /**
124
     * @return string
125
     */
126
    public function getLastModified()
127
    {
128
        return $this->lastModified;
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getName()
135
    {
136
        return $this->name;
137
    }
138
139
    /**
140
     * @return string
141
     */
142
    public function getRealm()
143
    {
144
        return $this->realm;
145
    }
146
147
    /**
148
     * @return string
149
     */
150
    public function getBattleGroup()
151
    {
152
        return $this->battleGroup;
153
    }
154
155
    /**
156
     * @return string
157
     */
158
    public function getClass()
159
    {
160
        return $this->class;
161
    }
162
163
    /**
164
     * @return string
165
     */
166
    public function getRace()
167
    {
168
        return $this->race;
169
    }
170
171
    /**
172
     * @return string
173
     */
174
    public function getGender()
175
    {
176
        return $this->gender;
177
    }
178
179
    /**
180
     * @return string
181
     */
182
    public function getLevel()
183
    {
184
        return $this->level;
185
    }
186
187
    /**
188
     * @return string
189
     */
190
    public function getAchievementPoints()
191
    {
192
        return $this->achievementPoints;
193
    }
194
195
    /**
196
     * @return string
197
     */
198
    public function getThumbnail()
199
    {
200
        return $this->thumbnail;
201
    }
202
203
    /**
204
     * @return string
205
     */
206
    public function getCalcClass()
207
    {
208
        return $this->calcClass;
209
    }
210
211
    /**
212
     * @return string
213
     */
214
    public function getFaction()
215
    {
216
        return $this->faction;
217
    }
218
219
    /**
220
     * @return string
221
     */
222
    public function getTotalHonorableKills()
223
    {
224
        return $this->totalHonorableKills;
225
    }
226
}
227