Test Failed
Push — master ( 67ec1c...f465f8 )
by Willy
06:35
created

AppearanceValueObject::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 19
ccs 0
cts 19
cp 0
rs 9.6333
c 0
b 0
f 0
cc 1
nc 1
nop 8
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\Appearance\Model;
4
5
/**
6
 * @author  Willy Reiche
7
 * @since   2017-07-22
8
 * @version 1.0
9
 */
10
class AppearanceValueObject
11
{
12
    /**
13
     * @var string
14
     */
15
    private $faceVariation;
16
17
    /**
18
     * @var string
19
     */
20
    private $skinColor;
21
22
    /**
23
     * @var string
24
     */
25
    private $hairVariation;
26
27
    /**
28
     * @var string
29
     */
30
    private $hairColor;
31
32
    /**
33
     * @var string
34
     */
35
    private $featureVariation;
36
37
    /**
38
     * @var string
39
     */
40
    private $showHelm;
41
42
    /**
43
     * @var string
44
     */
45
    private $showCloak;
46
47
    /**
48
     * @var string
49
     */
50
    private $customDisplayOptions;
51
52
    /**
53
     * AppearanceValueObject constructor.
54
     * @param string $faceVariation
55
     * @param string $skinColor
56
     * @param string $hairVariation
57
     * @param string $hairColor
58
     * @param string $featureVariation
59
     * @param string $showHelm
60
     * @param string $showCloak
61
     * @param string $customDisplayOptions
62
     */
63
    public function __construct(
64
        $faceVariation,
65
        $skinColor,
66
        $hairVariation,
67
        $hairColor,
68
        $featureVariation,
69
        $showHelm,
70
        $showCloak,
71
        $customDisplayOptions
72
    ) {
73
        $this->faceVariation = $faceVariation;
74
        $this->skinColor = $skinColor;
75
        $this->hairVariation = $hairVariation;
76
        $this->hairColor = $hairColor;
77
        $this->featureVariation = $featureVariation;
78
        $this->showHelm = $showHelm;
79
        $this->showCloak = $showCloak;
80
        $this->customDisplayOptions = $customDisplayOptions;
81
    }
82
83
    /**
84
     * @return string
85
     */
86
    public function getFaceVariation()
87
    {
88
        return $this->faceVariation;
89
    }
90
91
    /**
92
     * @return string
93
     */
94
    public function getSkinColor()
95
    {
96
        return $this->skinColor;
97
    }
98
99
    /**
100
     * @return string
101
     */
102
    public function getHairVariation()
103
    {
104
        return $this->hairVariation;
105
    }
106
107
    /**
108
     * @return string
109
     */
110
    public function getHairColor()
111
    {
112
        return $this->hairColor;
113
    }
114
115
    /**
116
     * @return string
117
     */
118
    public function getFeatureVariation()
119
    {
120
        return $this->featureVariation;
121
    }
122
123
    /**
124
     * @return string
125
     */
126
    public function getShowHelm()
127
    {
128
        return $this->showHelm;
129
    }
130
131
    /**
132
     * @return string
133
     */
134
    public function getShowCloak()
135
    {
136
        return $this->showCloak;
137
    }
138
139
    /**
140
     * @return string
141
     */
142
    public function getCustomDisplayOptions()
143
    {
144
        return $this->customDisplayOptions;
145
    }
146
}
147