Total Complexity | 49 |
Total Lines | 350 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like FindPointRetraitAcheminementByID often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use FindPointRetraitAcheminementByID, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
14 | class FindPointRetraitAcheminementByID extends AbstractStructBase |
||
15 | { |
||
16 | /** |
||
17 | * The accountNumber |
||
18 | * Meta information extracted from the WSDL |
||
19 | * - minOccurs: 0 |
||
20 | * @var string |
||
21 | */ |
||
22 | public $accountNumber; |
||
23 | /** |
||
24 | * The password |
||
25 | * Meta information extracted from the WSDL |
||
26 | * - minOccurs: 0 |
||
27 | * @var string |
||
28 | */ |
||
29 | public $password; |
||
30 | /** |
||
31 | * The apikey |
||
32 | * Meta information extracted from the WSDL |
||
33 | * - default: |
||
34 | * - minOccurs: 0 |
||
35 | * - nillable: true |
||
36 | * @var string |
||
37 | */ |
||
38 | public $apikey; |
||
39 | /** |
||
40 | * The codTiersPourPartenaire |
||
41 | * Meta information extracted from the WSDL |
||
42 | * - default: |
||
43 | * - minOccurs: 0 |
||
44 | * - nillable: true |
||
45 | * @var string |
||
46 | */ |
||
47 | public $codTiersPourPartenaire; |
||
48 | /** |
||
49 | * The id |
||
50 | * Meta information extracted from the WSDL |
||
51 | * - minOccurs: 0 |
||
52 | * @var string |
||
53 | */ |
||
54 | public $id; |
||
55 | /** |
||
56 | * The date |
||
57 | * Meta information extracted from the WSDL |
||
58 | * - minOccurs: 0 |
||
59 | * @var string |
||
60 | */ |
||
61 | public $date; |
||
62 | /** |
||
63 | * The weight |
||
64 | * Meta information extracted from the WSDL |
||
65 | * - minOccurs: 0 |
||
66 | * @var string |
||
67 | */ |
||
68 | public $weight; |
||
69 | /** |
||
70 | * The filterRelay |
||
71 | * Meta information extracted from the WSDL |
||
72 | * - minOccurs: 0 |
||
73 | * @var string |
||
74 | */ |
||
75 | public $filterRelay; |
||
76 | /** |
||
77 | * The reseau |
||
78 | * Meta information extracted from the WSDL |
||
79 | * - minOccurs: 0 |
||
80 | * @var string |
||
81 | */ |
||
82 | public $reseau; |
||
83 | /** |
||
84 | * The langue |
||
85 | * Meta information extracted from the WSDL |
||
86 | * - minOccurs: 0 |
||
87 | * @var string |
||
88 | */ |
||
89 | public $langue; |
||
90 | /** |
||
91 | * Constructor method for findPointRetraitAcheminementByID |
||
92 | * @uses FindPointRetraitAcheminementByID::setAccountNumber() |
||
93 | * @uses FindPointRetraitAcheminementByID::setPassword() |
||
94 | * @uses FindPointRetraitAcheminementByID::setApikey() |
||
95 | * @uses FindPointRetraitAcheminementByID::setCodTiersPourPartenaire() |
||
96 | * @uses FindPointRetraitAcheminementByID::setId() |
||
97 | * @uses FindPointRetraitAcheminementByID::setDate() |
||
98 | * @uses FindPointRetraitAcheminementByID::setWeight() |
||
99 | * @uses FindPointRetraitAcheminementByID::setFilterRelay() |
||
100 | * @uses FindPointRetraitAcheminementByID::setReseau() |
||
101 | * @uses FindPointRetraitAcheminementByID::setLangue() |
||
102 | * @param string $accountNumber |
||
103 | * @param string $password |
||
104 | * @param string $apikey |
||
105 | * @param string $codTiersPourPartenaire |
||
106 | * @param string $id |
||
107 | * @param string $date |
||
108 | * @param string $weight |
||
109 | * @param string $filterRelay |
||
110 | * @param string $reseau |
||
111 | * @param string $langue |
||
112 | */ |
||
113 | public function __construct($accountNumber = null, $password = null, $apikey = '', $codTiersPourPartenaire = '', $id = null, $date = null, $weight = null, $filterRelay = null, $reseau = null, $langue = null) |
||
114 | { |
||
115 | $this |
||
116 | ->setAccountNumber($accountNumber) |
||
117 | ->setPassword($password) |
||
118 | ->setApikey($apikey) |
||
119 | ->setCodTiersPourPartenaire($codTiersPourPartenaire) |
||
120 | ->setId($id) |
||
121 | ->setDate($date) |
||
122 | ->setWeight($weight) |
||
123 | ->setFilterRelay($filterRelay) |
||
124 | ->setReseau($reseau) |
||
125 | ->setLangue($langue); |
||
126 | } |
||
127 | /** |
||
128 | * Get accountNumber value |
||
129 | * @return string|null |
||
130 | */ |
||
131 | public function getAccountNumber() |
||
132 | { |
||
133 | return $this->accountNumber; |
||
134 | } |
||
135 | /** |
||
136 | * Set accountNumber value |
||
137 | * @param string $accountNumber |
||
138 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
139 | */ |
||
140 | public function setAccountNumber($accountNumber = null) |
||
141 | { |
||
142 | // validation for constraint: string |
||
143 | if (!is_null($accountNumber) && !is_string($accountNumber)) { |
||
|
|||
144 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($accountNumber, true), gettype($accountNumber)), __LINE__); |
||
145 | } |
||
146 | $this->accountNumber = $accountNumber; |
||
147 | return $this; |
||
148 | } |
||
149 | /** |
||
150 | * Get password value |
||
151 | * @return string|null |
||
152 | */ |
||
153 | public function getPassword() |
||
154 | { |
||
155 | return $this->password; |
||
156 | } |
||
157 | /** |
||
158 | * Set password value |
||
159 | * @param string $password |
||
160 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
161 | */ |
||
162 | public function setPassword($password = null) |
||
163 | { |
||
164 | // validation for constraint: string |
||
165 | if (!is_null($password) && !is_string($password)) { |
||
166 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__); |
||
167 | } |
||
168 | $this->password = $password; |
||
169 | return $this; |
||
170 | } |
||
171 | /** |
||
172 | * Get apikey value |
||
173 | * An additional test has been added (isset) before returning the property value as |
||
174 | * this property may have been unset before, due to the fact that this property is |
||
175 | * removable from the request (nillable=true+minOccurs=0) |
||
176 | * @return string|null |
||
177 | */ |
||
178 | public function getApikey() |
||
179 | { |
||
180 | return isset($this->apikey) ? $this->apikey : null; |
||
181 | } |
||
182 | /** |
||
183 | * Set apikey value |
||
184 | * This property is removable from request (nillable=true+minOccurs=0), therefore |
||
185 | * if the value assigned to this property is null, it is removed from this object |
||
186 | * @param string $apikey |
||
187 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
188 | */ |
||
189 | public function setApikey($apikey = '') |
||
201 | } |
||
202 | /** |
||
203 | * Get codTiersPourPartenaire value |
||
204 | * An additional test has been added (isset) before returning the property value as |
||
205 | * this property may have been unset before, due to the fact that this property is |
||
206 | * removable from the request (nillable=true+minOccurs=0) |
||
207 | * @return string|null |
||
208 | */ |
||
209 | public function getCodTiersPourPartenaire() |
||
212 | } |
||
213 | /** |
||
214 | * Set codTiersPourPartenaire value |
||
215 | * This property is removable from request (nillable=true+minOccurs=0), therefore |
||
216 | * if the value assigned to this property is null, it is removed from this object |
||
217 | * @param string $codTiersPourPartenaire |
||
218 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
219 | */ |
||
220 | public function setCodTiersPourPartenaire($codTiersPourPartenaire = '') |
||
221 | { |
||
222 | // validation for constraint: string |
||
223 | if (!is_null($codTiersPourPartenaire) && !is_string($codTiersPourPartenaire)) { |
||
224 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($codTiersPourPartenaire, true), gettype($codTiersPourPartenaire)), __LINE__); |
||
225 | } |
||
226 | if (is_null($codTiersPourPartenaire) || (is_array($codTiersPourPartenaire) && empty($codTiersPourPartenaire))) { |
||
227 | unset($this->codTiersPourPartenaire); |
||
228 | } else { |
||
229 | $this->codTiersPourPartenaire = $codTiersPourPartenaire; |
||
230 | } |
||
231 | return $this; |
||
232 | } |
||
233 | /** |
||
234 | * Get id value |
||
235 | * @return string|null |
||
236 | */ |
||
237 | public function getId() |
||
238 | { |
||
239 | return $this->id; |
||
240 | } |
||
241 | /** |
||
242 | * Set id value |
||
243 | * @param string $id |
||
244 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
245 | */ |
||
246 | public function setId($id = null) |
||
247 | { |
||
248 | // validation for constraint: string |
||
249 | if (!is_null($id) && !is_string($id)) { |
||
250 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($id, true), gettype($id)), __LINE__); |
||
251 | } |
||
252 | $this->id = $id; |
||
253 | return $this; |
||
254 | } |
||
255 | /** |
||
256 | * Get date value |
||
257 | * @return string|null |
||
258 | */ |
||
259 | public function getDate() |
||
260 | { |
||
261 | return $this->date; |
||
262 | } |
||
263 | /** |
||
264 | * Set date value |
||
265 | * @param string $date |
||
266 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
267 | */ |
||
268 | public function setDate($date = null) |
||
269 | { |
||
270 | // validation for constraint: string |
||
271 | if (!is_null($date) && !is_string($date)) { |
||
272 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($date, true), gettype($date)), __LINE__); |
||
273 | } |
||
274 | $this->date = $date; |
||
275 | return $this; |
||
276 | } |
||
277 | /** |
||
278 | * Get weight value |
||
279 | * @return string|null |
||
280 | */ |
||
281 | public function getWeight() |
||
284 | } |
||
285 | /** |
||
286 | * Set weight value |
||
287 | * @param string $weight |
||
288 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
289 | */ |
||
290 | public function setWeight($weight = null) |
||
291 | { |
||
292 | // validation for constraint: string |
||
293 | if (!is_null($weight) && !is_string($weight)) { |
||
294 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($weight, true), gettype($weight)), __LINE__); |
||
295 | } |
||
296 | $this->weight = $weight; |
||
297 | return $this; |
||
298 | } |
||
299 | /** |
||
300 | * Get filterRelay value |
||
301 | * @return string|null |
||
302 | */ |
||
303 | public function getFilterRelay() |
||
304 | { |
||
305 | return $this->filterRelay; |
||
306 | } |
||
307 | /** |
||
308 | * Set filterRelay value |
||
309 | * @param string $filterRelay |
||
310 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
311 | */ |
||
312 | public function setFilterRelay($filterRelay = null) |
||
320 | } |
||
321 | /** |
||
322 | * Get reseau value |
||
323 | * @return string|null |
||
324 | */ |
||
325 | public function getReseau() |
||
326 | { |
||
327 | return $this->reseau; |
||
328 | } |
||
329 | /** |
||
330 | * Set reseau value |
||
331 | * @param string $reseau |
||
332 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
333 | */ |
||
334 | public function setReseau($reseau = null) |
||
335 | { |
||
336 | // validation for constraint: string |
||
337 | if (!is_null($reseau) && !is_string($reseau)) { |
||
338 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($reseau, true), gettype($reseau)), __LINE__); |
||
339 | } |
||
340 | $this->reseau = $reseau; |
||
341 | return $this; |
||
342 | } |
||
343 | /** |
||
344 | * Get langue value |
||
345 | * @return string|null |
||
346 | */ |
||
347 | public function getLangue() |
||
350 | } |
||
351 | /** |
||
352 | * Set langue value |
||
353 | * @param string $langue |
||
354 | * @return \ColissimoPickupPoint\StructType\FindPointRetraitAcheminementByID |
||
355 | */ |
||
356 | public function setLangue($langue = null) |
||
357 | { |
||
358 | // validation for constraint: string |
||
359 | if (!is_null($langue) && !is_string($langue)) { |
||
364 | } |
||
365 | } |
||
366 |