Passed
Push — master ( 52dd57...a4c9fa )
by Willy
02:14
created

AppearanceValueObject::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 19
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 19
ccs 10
cts 10
cp 1
rs 9.4285
cc 1
eloc 17
nc 1
nop 8
crap 1

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 9
    public function __construct(
64
        $faceVariation,
65
        $skinColor,
66
        $hairVariation,
67
        $hairColor,
68
        $featureVariation,
69
        $showHelm,
70
        $showCloak,
71
        $customDisplayOptions
72
    ) {
73 9
        $this->faceVariation = $faceVariation;
74 9
        $this->skinColor = $skinColor;
75 9
        $this->hairVariation = $hairVariation;
76 9
        $this->hairColor = $hairColor;
77 9
        $this->featureVariation = $featureVariation;
78 9
        $this->showHelm = $showHelm;
79 9
        $this->showCloak = $showCloak;
80 9
        $this->customDisplayOptions = $customDisplayOptions;
81 9
    }
82
83
    /**
84
     * @return string
85
     */
86 1
    public function getFaceVariation()
87
    {
88 1
        return $this->faceVariation;
89
    }
90
91
    /**
92
     * @return string
93
     */
94 1
    public function getSkinColor()
95
    {
96 1
        return $this->skinColor;
97
    }
98
99
    /**
100
     * @return string
101
     */
102 1
    public function getHairVariation()
103
    {
104 1
        return $this->hairVariation;
105
    }
106
107
    /**
108
     * @return string
109
     */
110 1
    public function getHairColor()
111
    {
112 1
        return $this->hairColor;
113
    }
114
115
    /**
116
     * @return string
117
     */
118 1
    public function getFeatureVariation()
119
    {
120 1
        return $this->featureVariation;
121
    }
122
123
    /**
124
     * @return string
125
     */
126 1
    public function getShowHelm()
127
    {
128 1
        return $this->showHelm;
129
    }
130
131
    /**
132
     * @return string
133
     */
134 1
    public function getShowCloak()
135
    {
136 1
        return $this->showCloak;
137
    }
138
139
    /**
140
     * @return string
141
     */
142 1
    public function getCustomDisplayOptions()
143
    {
144 1
        return $this->customDisplayOptions;
145
    }
146
}
147