Total Complexity | 84 |
Total Lines | 463 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like ListEnvoi 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 ListEnvoi, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
82 | class ListEnvoi extends Model |
||
83 | { |
||
84 | public string $codeClient; |
||
85 | public string $codeProduit; |
||
86 | public string $codeSa; |
||
87 | public string $dateDepartEnlevement; |
||
88 | public array $destinataire; |
||
89 | public array $expediteur; |
||
90 | public array $listUmgs; |
||
91 | public ?bool $animauxPlumes = null; |
||
92 | public ?int $codeIncotermConditionLivraison = null; |
||
93 | public ?int $codeSaBureauRestant = null; |
||
94 | public ?bool $dangerEnvQteExcepteeMD = null; |
||
95 | public ?int $dangerEnvQteLimiteeMD = null; |
||
96 | public ?string $dateLivraison = null; |
||
97 | public ?string $emailConfirmationEnlevement = null; |
||
98 | public ?string $emailNotificationDestinataire = null; |
||
99 | public ?string $emailNotificationExpediteur = null; |
||
100 | public ?string $emailPriseEnChargeEnlevement = null; |
||
101 | public ?int $etage = null; |
||
102 | public ?int $hauteurTotale = null; |
||
103 | public ?bool $horsSite = null; |
||
104 | public ?int $idPointRelais = null; |
||
105 | public ?string $instructionEnlevement = null; |
||
106 | public ?string $instructionLivraison = null; |
||
107 | public ?int $largeurTotale = null; |
||
108 | public ?int $longueurTotale = null; |
||
109 | public ?string $natureMarchandise = null; |
||
110 | public ?int $nbColisQteExcepteeMD = null; |
||
111 | public ?int $noRecepisse = null; |
||
112 | public ?int $noSuivi = null; |
||
113 | public ?int $nosUmsAEtiqueter = null; |
||
114 | public ?string $optionLivraison = null; |
||
115 | public ?string $periodePreferenceEnlevement = null; |
||
116 | public ?int $poidsQteLimiteeMD = null; |
||
117 | public ?int $poidsTotal = null; |
||
118 | public ?string $reference1 = null; |
||
119 | public ?string $reference2 = null; |
||
120 | public ?bool $sadDepotage = null; |
||
121 | public ?bool $sadLivEtage = null; |
||
122 | public ?bool $sadMiseLieuUtil = null; |
||
123 | public ?bool $sadSwap = null; |
||
124 | public ?string $smsNotificationDestinataire = null; |
||
125 | public ?int $volumeTotal = null; |
||
126 | |||
127 | public function getCodeClient(): string |
||
128 | { |
||
129 | return $this->codeClient; |
||
130 | } |
||
131 | |||
132 | public function setCodeClient(string $codeClient): void |
||
133 | { |
||
134 | $this->codeClient = $codeClient; |
||
135 | } |
||
136 | |||
137 | public function getCodeProduit(): string |
||
138 | { |
||
139 | return $this->codeProduit; |
||
140 | } |
||
141 | |||
142 | public function setCodeProduit(string $codeProduit): void |
||
143 | { |
||
144 | $this->codeProduit = $codeProduit; |
||
145 | } |
||
146 | |||
147 | public function getCodeSa(): string |
||
148 | { |
||
149 | return $this->codeSa; |
||
150 | } |
||
151 | |||
152 | public function setCodeSa(string $codeSa): void |
||
153 | { |
||
154 | $this->codeSa = $codeSa; |
||
155 | } |
||
156 | |||
157 | public function getDateDepartEnlevement(): string |
||
158 | { |
||
159 | return $this->dateDepartEnlevement; |
||
160 | } |
||
161 | |||
162 | public function setDateDepartEnlevement(string $dateDepartEnlevement): void |
||
163 | { |
||
164 | $this->dateDepartEnlevement = $dateDepartEnlevement; |
||
165 | } |
||
166 | |||
167 | public function getDestinataire(): array |
||
168 | { |
||
169 | return $this->destinataire; |
||
170 | } |
||
171 | |||
172 | public function setDestinataire(array $destinataire): void |
||
173 | { |
||
174 | $this->destinataire = $destinataire; |
||
175 | } |
||
176 | |||
177 | public function getExpediteur(): array |
||
178 | { |
||
179 | return $this->expediteur; |
||
180 | } |
||
181 | |||
182 | public function setExpediteur(array $expediteur): void |
||
183 | { |
||
184 | $this->expediteur = $expediteur; |
||
185 | } |
||
186 | |||
187 | public function getListUmgs(): array |
||
188 | { |
||
189 | return $this->listUmgs; |
||
190 | } |
||
191 | |||
192 | public function setListUmgs(array $listUmgs): void |
||
193 | { |
||
194 | $this->listUmgs = $listUmgs; |
||
195 | } |
||
196 | |||
197 | public function getAnimauxPlumes(): ?bool |
||
198 | { |
||
199 | return $this->animauxPlumes; |
||
200 | } |
||
201 | |||
202 | public function setAnimauxPlumes(?bool $animauxPlumes): void |
||
203 | { |
||
204 | $this->animauxPlumes = $animauxPlumes; |
||
205 | } |
||
206 | |||
207 | public function getCodeIncotermConditionLivraison(): ?int |
||
208 | { |
||
209 | return $this->codeIncotermConditionLivraison; |
||
210 | } |
||
211 | |||
212 | public function setCodeIncotermConditionLivraison(?int $codeIncotermConditionLivraison): void |
||
213 | { |
||
214 | $this->codeIncotermConditionLivraison = $codeIncotermConditionLivraison; |
||
215 | } |
||
216 | |||
217 | public function getCodeSaBureauRestant(): ?int |
||
218 | { |
||
219 | return $this->codeSaBureauRestant; |
||
220 | } |
||
221 | |||
222 | public function setCodeSaBureauRestant(?int $codeSaBureauRestant): void |
||
223 | { |
||
224 | $this->codeSaBureauRestant = $codeSaBureauRestant; |
||
225 | } |
||
226 | |||
227 | public function getDangerEnvQteExcepteeMD(): ?bool |
||
228 | { |
||
229 | return $this->dangerEnvQteExcepteeMD; |
||
230 | } |
||
231 | |||
232 | public function setDangerEnvQteExcepteeMD(?bool $dangerEnvQteExcepteeMD): void |
||
233 | { |
||
234 | $this->dangerEnvQteExcepteeMD = $dangerEnvQteExcepteeMD; |
||
235 | } |
||
236 | |||
237 | public function getDangerEnvQteLimiteeMD(): ?int |
||
238 | { |
||
239 | return $this->dangerEnvQteLimiteeMD; |
||
240 | } |
||
241 | |||
242 | public function setDangerEnvQteLimiteeMD(?int $dangerEnvQteLimiteeMD): void |
||
243 | { |
||
244 | $this->dangerEnvQteLimiteeMD = $dangerEnvQteLimiteeMD; |
||
245 | } |
||
246 | |||
247 | public function getDateLivraison(): ?string |
||
248 | { |
||
249 | return $this->dateLivraison; |
||
250 | } |
||
251 | |||
252 | public function setDateLivraison(?string $dateLivraison): void |
||
253 | { |
||
254 | $this->dateLivraison = $dateLivraison; |
||
255 | } |
||
256 | |||
257 | public function getEmailConfirmationEnlevement(): ?string |
||
258 | { |
||
259 | return $this->emailConfirmationEnlevement; |
||
260 | } |
||
261 | |||
262 | public function setEmailConfirmationEnlevement(?string $emailConfirmationEnlevement): void |
||
263 | { |
||
264 | $this->emailConfirmationEnlevement = $emailConfirmationEnlevement; |
||
265 | } |
||
266 | |||
267 | public function getEmailNotificationDestinataire(): ?string |
||
268 | { |
||
269 | return $this->emailNotificationDestinataire; |
||
270 | } |
||
271 | |||
272 | public function setEmailNotificationDestinataire(?string $emailNotificationDestinataire): void |
||
273 | { |
||
274 | $this->emailNotificationDestinataire = $emailNotificationDestinataire; |
||
275 | } |
||
276 | |||
277 | public function getEmailNotificationExpediteur(): ?string |
||
278 | { |
||
279 | return $this->emailNotificationExpediteur; |
||
280 | } |
||
281 | |||
282 | public function setEmailNotificationExpediteur(?string $emailNotificationExpediteur): void |
||
283 | { |
||
284 | $this->emailNotificationExpediteur = $emailNotificationExpediteur; |
||
285 | } |
||
286 | |||
287 | public function getEmailPriseEnChargeEnlevement(): ?string |
||
288 | { |
||
289 | return $this->emailPriseEnChargeEnlevement; |
||
290 | } |
||
291 | |||
292 | public function setEmailPriseEnChargeEnlevement(?string $emailPriseEnChargeEnlevement): void |
||
293 | { |
||
294 | $this->emailPriseEnChargeEnlevement = $emailPriseEnChargeEnlevement; |
||
295 | } |
||
296 | |||
297 | public function getEtage(): ?int |
||
298 | { |
||
299 | return $this->etage; |
||
300 | } |
||
301 | |||
302 | public function setEtage(?int $etage): void |
||
303 | { |
||
304 | $this->etage = $etage; |
||
305 | } |
||
306 | |||
307 | public function getHauteurTotale(): ?int |
||
308 | { |
||
309 | return $this->hauteurTotale; |
||
310 | } |
||
311 | |||
312 | public function setHauteurTotale(?int $hauteurTotale): void |
||
313 | { |
||
314 | $this->hauteurTotale = $hauteurTotale; |
||
315 | } |
||
316 | |||
317 | public function getHorsSite(): ?bool |
||
318 | { |
||
319 | return $this->horsSite; |
||
320 | } |
||
321 | |||
322 | public function setHorsSite(?bool $horsSite): void |
||
323 | { |
||
324 | $this->horsSite = $horsSite; |
||
325 | } |
||
326 | |||
327 | public function getIdPointRelais(): ?int |
||
328 | { |
||
329 | return $this->idPointRelais; |
||
330 | } |
||
331 | |||
332 | public function setIdPointRelais(?int $idPointRelais): void |
||
333 | { |
||
334 | $this->idPointRelais = $idPointRelais; |
||
335 | } |
||
336 | |||
337 | public function getInstructionEnlevement(): ?string |
||
338 | { |
||
339 | return $this->instructionEnlevement; |
||
340 | } |
||
341 | |||
342 | public function setInstructionEnlevement(?string $instructionEnlevement): void |
||
343 | { |
||
344 | $this->instructionEnlevement = $instructionEnlevement; |
||
345 | } |
||
346 | |||
347 | public function getInstructionLivraison(): ?string |
||
348 | { |
||
349 | return $this->instructionLivraison; |
||
350 | } |
||
351 | |||
352 | public function setInstructionLivraison(?string $instructionLivraison): void |
||
353 | { |
||
354 | $this->instructionLivraison = $instructionLivraison; |
||
355 | } |
||
356 | |||
357 | public function getLargeurTotale(): ?int |
||
358 | { |
||
359 | return $this->largeurTotale; |
||
360 | } |
||
361 | |||
362 | public function setLargeurTotale(?int $largeurTotale): void |
||
363 | { |
||
364 | $this->largeurTotale = $largeurTotale; |
||
365 | } |
||
366 | |||
367 | public function getLongueurTotale(): ?int |
||
368 | { |
||
369 | return $this->longueurTotale; |
||
370 | } |
||
371 | |||
372 | public function setLongueurTotale(?int $longueurTotale): void |
||
373 | { |
||
374 | $this->longueurTotale = $longueurTotale; |
||
375 | } |
||
376 | |||
377 | public function getNatureMarchandise(): ?string |
||
378 | { |
||
379 | return $this->natureMarchandise; |
||
380 | } |
||
381 | |||
382 | public function setNatureMarchandise(?string $natureMarchandise): void |
||
383 | { |
||
384 | $this->natureMarchandise = $natureMarchandise; |
||
385 | } |
||
386 | |||
387 | public function getNbColisQteExcepteeMD(): ?int |
||
390 | } |
||
391 | |||
392 | public function setNbColisQteExcepteeMD(?int $nbColisQteExcepteeMD): void |
||
393 | { |
||
394 | $this->nbColisQteExcepteeMD = $nbColisQteExcepteeMD; |
||
395 | } |
||
396 | |||
397 | public function getNoRecepisse(): ?int |
||
398 | { |
||
399 | return $this->noRecepisse; |
||
400 | } |
||
401 | |||
402 | public function setNoRecepisse(?int $noRecepisse): void |
||
403 | { |
||
404 | $this->noRecepisse = $noRecepisse; |
||
405 | } |
||
406 | |||
407 | public function getNoSuivi(): ?int |
||
408 | { |
||
409 | return $this->noSuivi; |
||
410 | } |
||
411 | |||
412 | public function setNoSuivi(?int $noSuivi): void |
||
413 | { |
||
414 | $this->noSuivi = $noSuivi; |
||
415 | } |
||
416 | |||
417 | public function getNosUmsAEtiqueter(): ?int |
||
418 | { |
||
419 | return $this->nosUmsAEtiqueter; |
||
420 | } |
||
421 | |||
422 | public function setNosUmsAEtiqueter(?int $nosUmsAEtiqueter): void |
||
423 | { |
||
424 | $this->nosUmsAEtiqueter = $nosUmsAEtiqueter; |
||
425 | } |
||
426 | |||
427 | public function getOptionLivraison(): ?string |
||
428 | { |
||
429 | return $this->optionLivraison; |
||
430 | } |
||
431 | |||
432 | public function setOptionLivraison(?string $optionLivraison): void |
||
433 | { |
||
434 | $this->optionLivraison = $optionLivraison; |
||
435 | } |
||
436 | |||
437 | public function getPeriodePreferenceEnlevement(): ?string |
||
438 | { |
||
439 | return $this->periodePreferenceEnlevement; |
||
440 | } |
||
441 | |||
442 | public function setPeriodePreferenceEnlevement(?string $periodePreferenceEnlevement): void |
||
443 | { |
||
444 | $this->periodePreferenceEnlevement = $periodePreferenceEnlevement; |
||
445 | } |
||
446 | |||
447 | public function getPoidsQteLimiteeMD(): ?int |
||
448 | { |
||
449 | return $this->poidsQteLimiteeMD; |
||
450 | } |
||
451 | |||
452 | public function setPoidsQteLimiteeMD(?int $poidsQteLimiteeMD): void |
||
453 | { |
||
454 | $this->poidsQteLimiteeMD = $poidsQteLimiteeMD; |
||
455 | } |
||
456 | |||
457 | public function getPoidsTotal(): ?int |
||
458 | { |
||
459 | return $this->poidsTotal; |
||
460 | } |
||
461 | |||
462 | public function setPoidsTotal(?int $poidsTotal): void |
||
463 | { |
||
464 | $this->poidsTotal = $poidsTotal; |
||
465 | } |
||
466 | |||
467 | public function getReference1(): ?string |
||
468 | { |
||
469 | return $this->reference1; |
||
470 | } |
||
471 | |||
472 | public function setReference1(?string $reference1): void |
||
473 | { |
||
474 | $this->reference1 = $reference1; |
||
475 | } |
||
476 | |||
477 | public function getReference2(): ?string |
||
480 | } |
||
481 | |||
482 | public function setReference2(?string $reference2): void |
||
483 | { |
||
484 | $this->reference2 = $reference2; |
||
485 | } |
||
486 | |||
487 | public function getSadDepotage(): ?bool |
||
488 | { |
||
489 | return $this->sadDepotage; |
||
490 | } |
||
491 | |||
492 | public function setSadDepotage(?bool $sadDepotage): void |
||
493 | { |
||
494 | $this->sadDepotage = $sadDepotage; |
||
495 | } |
||
496 | |||
497 | public function getSadLivEtage(): ?bool |
||
498 | { |
||
499 | return $this->sadLivEtage; |
||
500 | } |
||
501 | |||
502 | public function setSadLivEtage(?bool $sadLivEtage): void |
||
503 | { |
||
504 | $this->sadLivEtage = $sadLivEtage; |
||
505 | } |
||
506 | |||
507 | public function getSadMiseLieuUtil(): ?bool |
||
508 | { |
||
509 | return $this->sadMiseLieuUtil; |
||
510 | } |
||
511 | |||
512 | public function setSadMiseLieuUtil(?bool $sadMiseLieuUtil): void |
||
515 | } |
||
516 | |||
517 | public function getSadSwap(): ?bool |
||
518 | { |
||
519 | return $this->sadSwap; |
||
520 | } |
||
521 | |||
522 | public function setSadSwap(?bool $sadSwap): void |
||
523 | { |
||
524 | $this->sadSwap = $sadSwap; |
||
525 | } |
||
526 | |||
527 | public function getSmsNotificationDestinataire(): ?string |
||
528 | { |
||
529 | return $this->smsNotificationDestinataire; |
||
530 | } |
||
531 | |||
532 | public function setSmsNotificationDestinataire(?string $smsNotificationDestinataire): void |
||
535 | } |
||
536 | |||
537 | public function getVolumeTotal(): ?int |
||
538 | { |
||
539 | return $this->volumeTotal; |
||
540 | } |
||
541 | |||
542 | public function setVolumeTotal(?int $volumeTotal): void |
||
543 | { |
||
544 | $this->volumeTotal = $volumeTotal; |
||
545 | } |
||
546 | } |
||
547 |