Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like Shipping 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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
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 Shipping, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
29 | class Shipping extends \Eccube\Entity\AbstractEntity |
||
30 | { |
||
31 | use NameTrait; |
||
32 | |||
33 | 26 | public function getShippingMultipleDefaultName() |
|
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | * |
||
41 | * @ORM\Column(name="id", type="integer", options={"unsigned":true}) |
||
42 | * @ORM\Id |
||
43 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
44 | */ |
||
45 | private $id; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | * |
||
50 | * @ORM\Column(name="name01", type="string", length=255) |
||
51 | */ |
||
52 | private $name01; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | * |
||
57 | * @ORM\Column(name="name02", type="string", length=255) |
||
58 | */ |
||
59 | private $name02; |
||
60 | |||
61 | /** |
||
62 | * @var string |
||
63 | * |
||
64 | * @ORM\Column(name="kana01", type="string", length=255) |
||
65 | */ |
||
66 | private $kana01; |
||
67 | |||
68 | /** |
||
69 | * @var string |
||
70 | * |
||
71 | * @ORM\Column(name="kana02", type="string", length=255) |
||
72 | */ |
||
73 | private $kana02; |
||
74 | |||
75 | /** |
||
76 | * @var string|null |
||
77 | * |
||
78 | * @ORM\Column(name="company_name", type="string", length=255, nullable=true) |
||
79 | */ |
||
80 | private $company_name; |
||
81 | |||
82 | /** |
||
83 | * @var string|null |
||
84 | * |
||
85 | * @ORM\Column(name="phone_number", type="string", length=14, nullable=true) |
||
86 | */ |
||
87 | private $phone_number; |
||
88 | |||
89 | /** |
||
90 | * @var string|null |
||
91 | * |
||
92 | * @ORM\Column(name="postal_code", type="string", length=8, nullable=true) |
||
93 | */ |
||
94 | private $postal_code; |
||
95 | |||
96 | /** |
||
97 | * @var string|null |
||
98 | * |
||
99 | * @ORM\Column(name="addr01", type="string", length=255, nullable=true) |
||
100 | */ |
||
101 | private $addr01; |
||
102 | |||
103 | /** |
||
104 | * @var string|null |
||
105 | * |
||
106 | * @ORM\Column(name="addr02", type="string", length=255, nullable=true) |
||
107 | */ |
||
108 | private $addr02; |
||
109 | |||
110 | /** |
||
111 | * @var string|null |
||
112 | * |
||
113 | * @ORM\Column(name="delivery_name", type="string", length=255, nullable=true) |
||
114 | */ |
||
115 | private $shipping_delivery_name; |
||
116 | |||
117 | /** |
||
118 | * @var int |
||
119 | * |
||
120 | * @ORM\Column(name="time_id", type="integer", options={"unsigned":true}, nullable=true) |
||
121 | */ |
||
122 | private $time_id; |
||
123 | |||
124 | /** |
||
125 | * @var int |
||
126 | * |
||
127 | * @ORM\Column(name="fee_id", type="integer", options={"unsigned":true}, nullable=true) |
||
128 | */ |
||
129 | private $fee_id; |
||
130 | |||
131 | /** |
||
132 | * @var string|null |
||
133 | * |
||
134 | * @ORM\Column(name="delivery_time", type="string", length=255, nullable=true) |
||
135 | */ |
||
136 | private $shipping_delivery_time; |
||
137 | |||
138 | /** |
||
139 | * お届け予定日/お届け希望日 |
||
140 | * |
||
141 | * @var \DateTime|null |
||
142 | * |
||
143 | * @ORM\Column(name="delivery_date", type="datetimetz", nullable=true) |
||
144 | */ |
||
145 | private $shipping_delivery_date; |
||
146 | |||
147 | /** |
||
148 | * @var string|null |
||
149 | * |
||
150 | * @ORM\Column(name="delivery_fee", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true,"default":0}) |
||
151 | */ |
||
152 | private $shipping_delivery_fee = 0; |
||
153 | |||
154 | /** |
||
155 | * 出荷日 |
||
156 | * |
||
157 | * @var \DateTime|null |
||
158 | * |
||
159 | * @ORM\Column(name="shipping_date", type="datetimetz", nullable=true) |
||
160 | */ |
||
161 | private $shipping_date; |
||
162 | |||
163 | /** |
||
164 | * @var string |
||
165 | * |
||
166 | * @ORM\Column(name="tracking_number", type="string", length=255, nullable=true) |
||
167 | */ |
||
168 | private $tracking_number; |
||
169 | |||
170 | /** |
||
171 | * @var string |
||
172 | * |
||
173 | * @ORM\Column(name="note", type="string", length=4000, nullable=true) |
||
174 | */ |
||
175 | private $note; |
||
176 | |||
177 | /** |
||
178 | * @var int|null |
||
179 | * |
||
180 | * @ORM\Column(name="sort_no", type="smallint", nullable=true, options={"unsigned":true}) |
||
181 | */ |
||
182 | private $sort_no; |
||
183 | |||
184 | /** |
||
185 | * @var \DateTime |
||
186 | * |
||
187 | * @ORM\Column(name="create_date", type="datetimetz") |
||
188 | */ |
||
189 | private $create_date; |
||
190 | |||
191 | /** |
||
192 | * @var \DateTime |
||
193 | * |
||
194 | * @ORM\Column(name="update_date", type="datetimetz") |
||
195 | */ |
||
196 | private $update_date; |
||
197 | |||
198 | /** |
||
199 | * @var \DateTime |
||
200 | * |
||
201 | * @ORM\Column(name="mail_send_date", type="datetimetz", nullable=true) |
||
202 | */ |
||
203 | private $mail_send_date; |
||
204 | |||
205 | /** |
||
206 | * @var \Eccube\Entity\Order |
||
207 | * |
||
208 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Order", inversedBy="Shippings", cascade={"persist"}) |
||
209 | * @ORM\JoinColumns({ |
||
210 | * @ORM\JoinColumn(name="order_id", referencedColumnName="id") |
||
211 | * }) |
||
212 | */ |
||
213 | private $Order; |
||
214 | |||
215 | /** |
||
216 | * @var \Doctrine\Common\Collections\Collection |
||
217 | * |
||
218 | * @ORM\OneToMany(targetEntity="Eccube\Entity\OrderItem", mappedBy="Shipping", cascade={"persist"}) |
||
219 | */ |
||
220 | private $OrderItems; |
||
221 | |||
222 | /** |
||
223 | * @var \Eccube\Entity\Master\Country |
||
224 | * |
||
225 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Country") |
||
226 | * @ORM\JoinColumns({ |
||
227 | * @ORM\JoinColumn(name="country_id", referencedColumnName="id") |
||
228 | * }) |
||
229 | */ |
||
230 | private $Country; |
||
231 | |||
232 | /** |
||
233 | * @var \Eccube\Entity\Master\Pref |
||
234 | * |
||
235 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Master\Pref") |
||
236 | * @ORM\JoinColumns({ |
||
237 | * @ORM\JoinColumn(name="pref_id", referencedColumnName="id") |
||
238 | * }) |
||
239 | */ |
||
240 | private $Pref; |
||
241 | |||
242 | /** |
||
243 | * @var \Eccube\Entity\Delivery |
||
244 | * |
||
245 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Delivery") |
||
246 | * @ORM\JoinColumns({ |
||
247 | * @ORM\JoinColumn(name="delivery_id", referencedColumnName="id") |
||
248 | * }) |
||
249 | */ |
||
250 | private $Delivery; |
||
251 | |||
252 | /** |
||
253 | * @var \Eccube\Entity\ProductClass |
||
254 | */ |
||
255 | private $ProductClassOfTemp; |
||
256 | |||
257 | /** |
||
258 | * @var \Eccube\Entity\Member |
||
259 | * |
||
260 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member") |
||
261 | * @ORM\JoinColumns({ |
||
262 | * @ORM\JoinColumn(name="creator_id", referencedColumnName="id") |
||
263 | * }) |
||
264 | */ |
||
265 | private $Creator; |
||
266 | |||
267 | /** |
||
268 | * Constructor |
||
269 | */ |
||
270 | 233 | public function __construct() |
|
274 | |||
275 | /** |
||
276 | * CustomerAddress から個人情報を設定. |
||
277 | * |
||
278 | * @param \Eccube\Entity\CustomerAddress $CustomerAddress |
||
279 | * |
||
280 | * @return \Eccube\Entity\Shipping |
||
281 | */ |
||
282 | 25 | View Code Duplication | public function setFromCustomerAddress(CustomerAddress $CustomerAddress) |
298 | |||
299 | /** |
||
300 | * 個人情報をクリア. |
||
301 | * |
||
302 | * @return \Eccube\Entity\Shipping |
||
303 | */ |
||
304 | public function clearCustomerAddress() |
||
320 | |||
321 | /** |
||
322 | * Get id. |
||
323 | * |
||
324 | * @return int |
||
325 | */ |
||
326 | 85 | public function getId() |
|
330 | |||
331 | /** |
||
332 | * Set name01. |
||
333 | * |
||
334 | * @param string $name01 |
||
335 | * |
||
336 | * @return Shipping |
||
337 | */ |
||
338 | 79 | public function setName01($name01) |
|
344 | |||
345 | /** |
||
346 | * Get name01. |
||
347 | * |
||
348 | * @return string |
||
349 | */ |
||
350 | 85 | public function getName01() |
|
354 | |||
355 | /** |
||
356 | * Set name02. |
||
357 | * |
||
358 | * @param string $name02 |
||
359 | * |
||
360 | * @return Shipping |
||
361 | */ |
||
362 | 68 | public function setName02($name02) |
|
368 | |||
369 | /** |
||
370 | * Get name02. |
||
371 | * |
||
372 | * @return string |
||
373 | */ |
||
374 | 83 | public function getName02() |
|
378 | |||
379 | /** |
||
380 | * Set kana01. |
||
381 | * |
||
382 | * @param string $kana01 |
||
383 | * |
||
384 | * @return Shipping |
||
385 | */ |
||
386 | 68 | public function setKana01($kana01) |
|
392 | |||
393 | /** |
||
394 | * Get kana01. |
||
395 | * |
||
396 | * @return string |
||
397 | */ |
||
398 | 76 | public function getKana01() |
|
402 | |||
403 | /** |
||
404 | * Set kana02. |
||
405 | * |
||
406 | * @param string $kana02 |
||
407 | * |
||
408 | * @return Shipping |
||
409 | */ |
||
410 | 67 | public function setKana02($kana02) |
|
416 | |||
417 | /** |
||
418 | * Get kana02. |
||
419 | * |
||
420 | * @return string |
||
421 | */ |
||
422 | 75 | public function getKana02() |
|
426 | |||
427 | /** |
||
428 | * Set companyName. |
||
429 | * |
||
430 | * @param string|null $companyName |
||
431 | * |
||
432 | * @return Shipping |
||
433 | */ |
||
434 | 54 | public function setCompanyName($companyName = null) |
|
440 | |||
441 | /** |
||
442 | * Get companyName. |
||
443 | * |
||
444 | * @return string|null |
||
445 | */ |
||
446 | 36 | public function getCompanyName() |
|
450 | |||
451 | /** |
||
452 | * Set phone_number. |
||
453 | * |
||
454 | * @param string|null $phone_number |
||
455 | * |
||
456 | * @return Shipping |
||
457 | */ |
||
458 | 67 | public function setPhoneNumber($phone_number = null) |
|
464 | |||
465 | /** |
||
466 | * Get phone_number. |
||
467 | * |
||
468 | * @return string|null |
||
469 | */ |
||
470 | 75 | public function getPhoneNumber() |
|
474 | |||
475 | /** |
||
476 | * Set postal_code. |
||
477 | * |
||
478 | * @param string|null $postal_code |
||
479 | * |
||
480 | * @return Shipping |
||
481 | */ |
||
482 | 67 | public function setPostalCode($postal_code = null) |
|
488 | |||
489 | /** |
||
490 | * Get postal_code. |
||
491 | * |
||
492 | * @return string|null |
||
493 | */ |
||
494 | 75 | public function getPostalCode() |
|
498 | |||
499 | /** |
||
500 | * Set addr01. |
||
501 | * |
||
502 | * @param string|null $addr01 |
||
503 | * |
||
504 | * @return Shipping |
||
505 | */ |
||
506 | 66 | public function setAddr01($addr01 = null) |
|
512 | |||
513 | /** |
||
514 | * Get addr01. |
||
515 | * |
||
516 | * @return string|null |
||
517 | */ |
||
518 | 75 | public function getAddr01() |
|
522 | |||
523 | /** |
||
524 | * Set addr02. |
||
525 | * |
||
526 | * @param string|null $addr02 |
||
527 | * |
||
528 | * @return Shipping |
||
529 | */ |
||
530 | 67 | public function setAddr02($addr02 = null) |
|
536 | |||
537 | /** |
||
538 | * Get addr02. |
||
539 | * |
||
540 | * @return string|null |
||
541 | */ |
||
542 | 75 | public function getAddr02() |
|
546 | |||
547 | /** |
||
548 | * Set shippingDeliveryName. |
||
549 | * |
||
550 | * @param string|null $shippingDeliveryName |
||
551 | * |
||
552 | * @return Shipping |
||
553 | */ |
||
554 | 221 | public function setShippingDeliveryName($shippingDeliveryName = null) |
|
560 | |||
561 | /** |
||
562 | * Get shippingDeliveryName. |
||
563 | * |
||
564 | * @return string|null |
||
565 | */ |
||
566 | 1 | public function getShippingDeliveryName() |
|
570 | |||
571 | /** |
||
572 | * Set shippingDeliveryTime. |
||
573 | * |
||
574 | * @param string|null $shippingDeliveryTime |
||
575 | * |
||
576 | * @return Shipping |
||
577 | */ |
||
578 | 25 | public function setShippingDeliveryTime($shippingDeliveryTime = null) |
|
584 | |||
585 | /** |
||
586 | * Get shippingDeliveryTime. |
||
587 | * |
||
588 | * @return string|null |
||
589 | */ |
||
590 | 16 | public function getShippingDeliveryTime() |
|
594 | |||
595 | /** |
||
596 | * Set shippingDeliveryDate. |
||
597 | * |
||
598 | * @param \DateTime|null $shippingDeliveryDate |
||
599 | * |
||
600 | * @return Shipping |
||
601 | */ |
||
602 | 43 | public function setShippingDeliveryDate($shippingDeliveryDate = null) |
|
608 | |||
609 | /** |
||
610 | * Get shippingDeliveryDate. |
||
611 | * |
||
612 | * @return \DateTime|null |
||
613 | */ |
||
614 | 69 | public function getShippingDeliveryDate() |
|
618 | |||
619 | /** |
||
620 | * Set shippingDeliveryFee. |
||
621 | * |
||
622 | * @param string|null $shippingDeliveryFee |
||
623 | * |
||
624 | * @return Shipping |
||
625 | */ |
||
626 | 208 | public function setShippingDeliveryFee($shippingDeliveryFee = null) |
|
632 | |||
633 | /** |
||
634 | * Get shippingDeliveryFee. |
||
635 | * |
||
636 | * @return string|null |
||
637 | */ |
||
638 | 208 | public function getShippingDeliveryFee() |
|
642 | |||
643 | /** |
||
644 | * Set shippingDate. |
||
645 | * |
||
646 | * @param \DateTime|null $shippingDate |
||
647 | * |
||
648 | * @return Shipping |
||
649 | */ |
||
650 | 7 | public function setShippingDate($shippingDate = null) |
|
656 | |||
657 | /** |
||
658 | * Get shippingDate. |
||
659 | * |
||
660 | * @return \DateTime|null |
||
661 | */ |
||
662 | 22 | public function getShippingDate() |
|
666 | |||
667 | /** |
||
668 | * Set sortNo. |
||
669 | * |
||
670 | * @param int|null $sortNo |
||
671 | * |
||
672 | * @return Shipping |
||
673 | */ |
||
674 | public function setSortNo($sortNo = null) |
||
680 | |||
681 | /** |
||
682 | * Get sortNo. |
||
683 | * |
||
684 | * @return int|null |
||
685 | */ |
||
686 | public function getSortNo() |
||
690 | |||
691 | /** |
||
692 | * Set createDate. |
||
693 | * |
||
694 | * @param \DateTime $createDate |
||
695 | * |
||
696 | * @return Shipping |
||
697 | */ |
||
698 | 210 | public function setCreateDate($createDate) |
|
704 | |||
705 | /** |
||
706 | * Get createDate. |
||
707 | * |
||
708 | * @return \DateTime |
||
709 | */ |
||
710 | public function getCreateDate() |
||
714 | |||
715 | /** |
||
716 | * Set updateDate. |
||
717 | * |
||
718 | * @param \DateTime $updateDate |
||
719 | * |
||
720 | * @return Shipping |
||
721 | */ |
||
722 | 210 | public function setUpdateDate($updateDate) |
|
728 | |||
729 | /** |
||
730 | * Get updateDate. |
||
731 | * |
||
732 | * @return \DateTime |
||
733 | */ |
||
734 | 2 | public function getUpdateDate() |
|
738 | |||
739 | /** |
||
740 | * Set mailSendDate. |
||
741 | * |
||
742 | * @param \DateTime $mailSendDate |
||
743 | * |
||
744 | * @return Shipping |
||
745 | */ |
||
746 | 3 | public function setMailSendDate($mailSendDate) |
|
752 | |||
753 | /** |
||
754 | * Get mailSendDate. |
||
755 | * |
||
756 | * @return \DateTime |
||
757 | */ |
||
758 | 2 | public function getMailSendDate() |
|
762 | |||
763 | /** |
||
764 | * Add orderItem. |
||
765 | * |
||
766 | * @param \Eccube\Entity\OrderItem $OrderItem |
||
767 | * |
||
768 | * @return Shipping |
||
769 | */ |
||
770 | 219 | public function addOrderItem(\Eccube\Entity\OrderItem $OrderItem) |
|
776 | |||
777 | /** |
||
778 | * Remove orderItem. |
||
779 | * |
||
780 | * @param \Eccube\Entity\OrderItem $OrderItem |
||
781 | * |
||
782 | * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
||
783 | */ |
||
784 | 28 | public function removeOrderItem(\Eccube\Entity\OrderItem $OrderItem) |
|
788 | |||
789 | /** |
||
790 | * Get orderItems. |
||
791 | * |
||
792 | * @return \Doctrine\Common\Collections\Collection |
||
793 | */ |
||
794 | 87 | public function getOrderItems() |
|
798 | |||
799 | /** |
||
800 | * 商品の受注明細を取得 |
||
801 | * |
||
802 | * @return OrderItem[] |
||
803 | */ |
||
804 | 60 | public function getProductOrderItems() |
|
810 | |||
811 | /** |
||
812 | * Set country. |
||
813 | * |
||
814 | * @param \Eccube\Entity\Master\Country|null $country |
||
815 | * |
||
816 | * @return Shipping |
||
817 | */ |
||
818 | public function setCountry(\Eccube\Entity\Master\Country $country = null) |
||
824 | |||
825 | /** |
||
826 | * Get country. |
||
827 | * |
||
828 | * @return \Eccube\Entity\Master\Country|null |
||
829 | */ |
||
830 | public function getCountry() |
||
834 | |||
835 | /** |
||
836 | * Set pref. |
||
837 | * |
||
838 | * @param \Eccube\Entity\Master\Pref|null $pref |
||
839 | * |
||
840 | * @return Shipping |
||
841 | */ |
||
842 | 221 | public function setPref(\Eccube\Entity\Master\Pref $pref = null) |
|
848 | |||
849 | /** |
||
850 | * Get pref. |
||
851 | * |
||
852 | * @return \Eccube\Entity\Master\Pref|null |
||
853 | */ |
||
854 | 89 | public function getPref() |
|
858 | |||
859 | /** |
||
860 | * Set delivery. |
||
861 | * |
||
862 | * @param \Eccube\Entity\Delivery|null $delivery |
||
863 | * |
||
864 | * @return Shipping |
||
865 | */ |
||
866 | 221 | public function setDelivery(\Eccube\Entity\Delivery $delivery = null) |
|
872 | |||
873 | /** |
||
874 | * Get delivery. |
||
875 | * |
||
876 | * @return \Eccube\Entity\Delivery|null |
||
877 | */ |
||
878 | 73 | public function getDelivery() |
|
882 | |||
883 | /** |
||
884 | * Product class of shipment item (temp) |
||
885 | * |
||
886 | * @return \Eccube\Entity\ProductClass |
||
887 | */ |
||
888 | 26 | public function getProductClassOfTemp() |
|
892 | |||
893 | /** |
||
894 | * Product class of shipment item (temp) |
||
895 | * |
||
896 | * @param \Eccube\Entity\ProductClass $ProductClassOfTemp |
||
897 | * |
||
898 | * @return $this |
||
899 | */ |
||
900 | 26 | public function setProductClassOfTemp(\Eccube\Entity\ProductClass $ProductClassOfTemp) |
|
906 | |||
907 | /** |
||
908 | * Set order. |
||
909 | * |
||
910 | * @param Order $Order |
||
911 | * |
||
912 | * @return $this |
||
913 | */ |
||
914 | 221 | public function setOrder(Order $Order) |
|
920 | |||
921 | /** |
||
922 | * Get order. |
||
923 | * |
||
924 | * @return Order |
||
925 | */ |
||
926 | 8 | public function getOrder() |
|
930 | |||
931 | /** |
||
932 | * Set trackingNumber |
||
933 | * |
||
934 | * @param string $trackingNumber |
||
935 | * |
||
936 | * @return Shipping |
||
937 | */ |
||
938 | 7 | public function setTrackingNumber($trackingNumber) |
|
944 | |||
945 | /** |
||
946 | * Get trackingNumber |
||
947 | * |
||
948 | * @return string |
||
949 | */ |
||
950 | 37 | public function getTrackingNumber() |
|
954 | |||
955 | /** |
||
956 | * Set note. |
||
957 | * |
||
958 | * @param string|null $note |
||
959 | * |
||
960 | * @return Shipping |
||
961 | */ |
||
962 | public function setNote($note = null) |
||
968 | |||
969 | /** |
||
970 | * Get note. |
||
971 | * |
||
972 | * @return string|null |
||
973 | */ |
||
974 | 21 | public function getNote() |
|
978 | |||
979 | /** |
||
980 | * 出荷済みの場合はtrue, 未出荷の場合はfalseを返す |
||
981 | * |
||
982 | * @return boolean |
||
983 | */ |
||
984 | public function isShipped() |
||
988 | |||
989 | /** |
||
990 | * Set timeId |
||
991 | * |
||
992 | * @param integer $timeId |
||
993 | * |
||
994 | * @return Shipping |
||
995 | */ |
||
996 | 25 | public function setTimeId($timeId) |
|
1002 | |||
1003 | /** |
||
1004 | * Get timeId |
||
1005 | * |
||
1006 | * @return integer |
||
1007 | */ |
||
1008 | 59 | public function getTimeId() |
|
1012 | |||
1013 | /** |
||
1014 | * Set feeId |
||
1015 | * |
||
1016 | * @param integer $feeId |
||
1017 | * |
||
1018 | * @return Shipping |
||
1019 | */ |
||
1020 | 208 | public function setFeeId($feeId) |
|
1026 | |||
1027 | /** |
||
1028 | * Get feeId |
||
1029 | * |
||
1030 | * @return integer |
||
1031 | */ |
||
1032 | public function getFeeId() |
||
1036 | |||
1037 | /** |
||
1038 | * Set creator. |
||
1039 | * |
||
1040 | * @param \Eccube\Entity\Member|null $creator |
||
1041 | * |
||
1042 | * @return Shipping |
||
1043 | */ |
||
1044 | 11 | public function setCreator(\Eccube\Entity\Member $creator = null) |
|
1050 | |||
1051 | /** |
||
1052 | * Get creator. |
||
1053 | * |
||
1054 | * @return \Eccube\Entity\Member|null |
||
1055 | */ |
||
1056 | 2 | public function getCreator() |
|
1060 | } |
||
1061 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.