Completed
Push — master ( 8acc04...458fbe )
by Laurent
02:26
created

CreatePilotYearBillCommand::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 11
dl 0
loc 25
rs 9.52
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
/**
4
 * @author Laurent De Coninck <[email protected]>
5
 */
6
class CreatePilotYearBillCommand
7
{
8
    /**
9
     * @var Pilot
10
     */
11
    private $pilot;
12
13
    /**
14
     * @var int
15
     */
16
    private $billType;
17
18
    /**
19
     * @var string
20
     */
21
    private $privateNote;
22
23
    /**
24
     * @var string
25
     */
26
    private $publicNote;
27
28
    /**
29
     * @var string
30
     */
31
    private $modelPdf;
32
33
    /**
34
     * @var int
35
     */
36
    private $reglementCondition;
37
38
    /**
39
     * @var int
40
     */
41
    private $reglementMode;
42
43
    /**
44
     * @var int
45
     */
46
    private $bankAccount;
47
48
    /**
49
     * @var string
50
     */
51
    private $year;
52
53
    /**
54
     * @var string
55
     */
56
    private $bonusAdditionalMessage;
57
58
    /**
59
     * @var int
60
     */
61
    private $additionalBonus;
62
63
    /**
64
     * CreatePilotYearBillCommand constructor.
65
     *
66
     * @param Pilot $pilot
67
     * @param int $billType
68
     * @param string $privateNote
69
     * @param string $publicNote
70
     * @param string $modelPdf
71
     * @param int $reglementCondition
72
     * @param int $reglementMode
73
     * @param int $bankAccount
74
     * @param string $year
75
     * @param string $bonusAdditionalMessage
76
     * @param int $additionalBonus
77
     */
78
    public function __construct(
79
        $pilot,
80
        $billType,
81
        $privateNote,
82
        $publicNote,
83
        $modelPdf,
84
        $reglementCondition,
85
        $reglementMode,
86
        $bankAccount,
87
        $year,
88
        $bonusAdditionalMessage,
89
        $additionalBonus
90
    ) {
91
        $this->pilot = $pilot;
92
        $this->billType = $billType;
93
        $this->privateNote = $privateNote;
94
        $this->publicNote = $publicNote;
95
        $this->modelPdf = $modelPdf;
96
        $this->reglementCondition = $reglementCondition;
97
        $this->reglementMode = $reglementMode;
98
        $this->bankAccount = $bankAccount;
99
        $this->year = $year;
100
        $this->bonusAdditionalMessage = $bonusAdditionalMessage;
101
        $this->additionalBonus = $additionalBonus;
102
    }
103
104
105
    /**
106
     * @return Pilot
107
     */
108
    public function getPilot()
109
    {
110
        return $this->pilot;
111
    }
112
113
    /**
114
     * @return int
115
     */
116
    public function getBillType()
117
    {
118
        return $this->billType;
119
    }
120
121
    /**
122
     * @return string
123
     */
124
    public function getPrivateNote()
125
    {
126
        return $this->privateNote;
127
    }
128
129
    /**
130
     * @return string
131
     */
132
    public function getPublicNote()
133
    {
134
        return $this->publicNote;
135
    }
136
137
    /**
138
     * @return string
139
     */
140
    public function getModelPdf()
141
    {
142
        return $this->modelPdf;
143
    }
144
145
    /**
146
     * @return int
147
     */
148
    public function getReglementCondition()
149
    {
150
        return $this->reglementCondition;
151
    }
152
153
    /**
154
     * @return int
155
     */
156
    public function getReglementMode()
157
    {
158
        return $this->reglementMode;
159
    }
160
161
    /**
162
     * @return int
163
     */
164
    public function getBankAccount()
165
    {
166
        return $this->bankAccount;
167
    }
168
169
    /**
170
     * @return string
171
     */
172
    public function getYear()
173
    {
174
        return $this->year;
175
    }
176
177
    /**
178
     * @return string
179
     */
180
    public function getBonusAdditionalMessage()
181
    {
182
        return $this->bonusAdditionalMessage;
183
    }
184
185
    /**
186
     * @return int
187
     */
188
    public function getAdditionalBonus()
189
    {
190
        return $this->additionalBonus;
191
    }
192
193
    /**
194
     * @return boolean
195
     */
196
    public function isReferenceHidden()
197
    {
198
    }
199
200
    /**
201
     * @return boolean
202
     */
203
    public function isDescriptionHidden()
204
    {
205
    }
206
207
    /**
208
     * @return boolean
209
     */
210
    public function isDetailsHidden()
211
    {
212
    }
213
214
}