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 UpdateOrderInfoRequest 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 UpdateOrderInfoRequest, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
24 | class UpdateOrderInfoRequest extends AbstractRequest |
||
25 | { |
||
26 | |||
27 | /** |
||
28 | * @return UpdateOrderInfoApi |
||
29 | */ |
||
30 | public function api() |
||
34 | |||
35 | /** |
||
36 | * @return UpdateOrderInfoResponse |
||
37 | */ |
||
38 | public function response() |
||
42 | |||
43 | /** |
||
44 | * @return void |
||
45 | */ |
||
46 | protected function validateParams() |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | public function getParams() |
||
62 | |||
63 | /** |
||
64 | * [必須]注文ID |
||
65 | * |
||
66 | * @param string $orderId |
||
67 | * @return self |
||
68 | */ |
||
69 | public function setOrderId(string $orderId): self |
||
70 | { |
||
71 | if (isset($this->params['Target']['OrderId'])) { |
||
72 | throw new LogicException('OrderId is already set.'); |
||
73 | } |
||
74 | $this->params['Target']['OrderId'] = $orderId; |
||
75 | |||
76 | return $this; |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * [必須]ストアアカウント |
||
81 | * |
||
82 | * @param string $sellerId |
||
83 | * @return self |
||
84 | */ |
||
85 | View Code Duplication | public function setSellerId(string $sellerId): self |
|
94 | |||
95 | /** |
||
96 | * 更新者名(ビジネスID登録氏名) |
||
97 | * セラー更新のみ |
||
98 | * |
||
99 | * @param string $operationUser |
||
100 | * @return self |
||
101 | */ |
||
102 | public function setOperationUser(string $operationUser): self |
||
103 | { |
||
104 | if (isset($this->params['Target']['OperationUser'])) { |
||
105 | throw new LogicException('OperationUser is already set.'); |
||
106 | } |
||
107 | $this->params['Target']['OperationUser'] = $operationUser; |
||
108 | |||
109 | return $this; |
||
110 | } |
||
111 | |||
112 | /** |
||
113 | * 閲覧済みフラグ |
||
114 | * 注文情報を更新した場合、自動で閲覧済みになります。 |
||
115 | * また、未閲覧から閲覧済みにのみ更新できます。 |
||
116 | * 閲覧済み→未閲覧:更新できません |
||
117 | * 未閲覧→閲覧済み:更新できます |
||
118 | * false : 未閲覧 |
||
119 | * true : 閲覧済み |
||
120 | * |
||
121 | * @return self |
||
122 | */ |
||
123 | public function setIsSeen(bool $isSeen): self |
||
124 | { |
||
125 | if (isset($this->params['Order']['IsSeen'])) { |
||
126 | throw new LogicException('IsSeen is already set.'); |
||
127 | } |
||
128 | $this->params['Order']['IsSeen'] = $isSeen ? 'true' : 'false'; |
||
129 | |||
130 | return $this; |
||
131 | } |
||
132 | |||
133 | /** |
||
134 | * 悪戯フラグ |
||
135 | * |
||
136 | * @param SuspectFlag $suspectFlag |
||
137 | * @return self |
||
138 | */ |
||
139 | public function setSuspect(SuspectFlag $suspectFlag): self |
||
140 | { |
||
141 | if (isset($this->params['Order']['Suspect'])) { |
||
142 | throw new LogicException('Suspect is already set.'); |
||
143 | } |
||
144 | $this->params['Order']['Suspect'] = $suspectFlag->getValue(); |
||
145 | |||
146 | return $this; |
||
147 | } |
||
148 | |||
149 | /** |
||
150 | * 支払い分類 |
||
151 | * |
||
152 | * @param PayType $payType |
||
153 | * @return self |
||
154 | */ |
||
155 | public function setPayType(PayType $payType): self |
||
156 | { |
||
157 | if (isset($this->params['Order']['PayType'])) { |
||
158 | throw new LogicException('PayType is already set.'); |
||
159 | } |
||
160 | $this->params['Order']['PayType'] = $payType->getValue(); |
||
161 | |||
162 | return $this; |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * 支払い種別 |
||
167 | * |
||
168 | * @param PayKind $payKind |
||
169 | * @return self |
||
170 | */ |
||
171 | public function setPayKind(PayKind $payKind): self |
||
172 | { |
||
173 | if (isset($this->params['Order']['PayKind'])) { |
||
174 | throw new LogicException('PayKind is already set.'); |
||
175 | } |
||
176 | $this->params['Order']['PayKind'] = $payKind->getValue(); |
||
177 | |||
178 | return $this; |
||
179 | } |
||
180 | |||
181 | /** |
||
182 | * 支払い方法 |
||
183 | * |
||
184 | * @param PayMethod $payMethod |
||
185 | * @return self |
||
186 | */ |
||
187 | public function setPayMethod(PayMethod $payMethod): self |
||
188 | { |
||
189 | if (isset($this->params['Order']['PayMethod'])) { |
||
190 | throw new LogicException('PayMethod is already set.'); |
||
191 | } |
||
192 | $this->params['Order']['PayMethod'] = $payMethod->getValue(); |
||
193 | |||
194 | return $this; |
||
195 | } |
||
196 | |||
197 | /** |
||
198 | * 支払い方法名称 |
||
199 | * max:150byte |
||
200 | * |
||
201 | * @param string $payMethodName |
||
202 | * @return self |
||
203 | */ |
||
204 | public function setPayMethodName(string $payMethodName): self |
||
205 | { |
||
206 | if (isset($this->params['Order']['PayMethodName'])) { |
||
207 | throw new LogicException('PayMethodName is already set.'); |
||
208 | } |
||
209 | $this->params['Order']['PayMethodName'] = $payMethodName; |
||
210 | |||
211 | return $this; |
||
212 | } |
||
213 | |||
214 | /** |
||
215 | * ストアステータス |
||
216 | * ストアが独自に設定可能なステータスです。 |
||
217 | * max:2byte |
||
218 | * |
||
219 | * @param string $storeStatus |
||
220 | * @return self |
||
221 | */ |
||
222 | public function setStoreStatus(string $storeStatus): self |
||
223 | { |
||
224 | if (isset($this->params['Order']['StoreStatus'])) { |
||
225 | throw new LogicException('StoreStatus is already set.'); |
||
226 | } |
||
227 | $this->params['Order']['StoreStatus'] = $storeStatus; |
||
228 | |||
229 | return $this; |
||
230 | } |
||
231 | |||
232 | /** |
||
233 | * 注文伝票出力時刻 |
||
234 | * 注文伝票を出力した日時です。 |
||
235 | * format:YYYYMMDDHH24MISS |
||
236 | * |
||
237 | * @param \DateTimeImmutable $printSlipTime |
||
238 | * @return self |
||
239 | */ |
||
240 | View Code Duplication | public function setPrintSlipTime(\DateTimeImmutable $printSlipTime): self |
|
249 | |||
250 | /** |
||
251 | * 納品書出力時刻 |
||
252 | * 納品書を出力した日時です。 |
||
253 | * format:YYYYMMDDHH24MISS |
||
254 | * |
||
255 | * @param \DateTimeImmutable $printDeliveryTime |
||
256 | * @return self |
||
257 | */ |
||
258 | View Code Duplication | public function setPrintDeliveryTime(\DateTimeImmutable $printDeliveryTime): self |
|
267 | |||
268 | /** |
||
269 | * 請求書出力時刻 |
||
270 | * 請求書を出力した日時です。 |
||
271 | * format:YYYYMMDDHH24MISS |
||
272 | * |
||
273 | * @param \DateTimeImmutable $printBillTime |
||
274 | * @return self |
||
275 | */ |
||
276 | View Code Duplication | public function setPrintBillTime(\DateTimeImmutable $printBillTime): self |
|
285 | |||
286 | /** |
||
287 | * バイヤーコメント |
||
288 | * ご要望欄入力内容です。 |
||
289 | * max:750byte |
||
290 | * |
||
291 | * @param string $buyerComments |
||
292 | * @return self |
||
293 | */ |
||
294 | public function setBuyerComments(string $buyerComments): self |
||
295 | { |
||
296 | if (isset($this->params['Order']['BuyerComments'])) { |
||
297 | throw new LogicException('BuyerComments is already set.'); |
||
298 | } |
||
299 | $this->params['Order']['BuyerComments'] = $buyerComments; |
||
300 | |||
301 | return $this; |
||
302 | } |
||
303 | |||
304 | /** |
||
305 | * セラーコメント |
||
306 | * セラーがカートに表示しているコメント文字列です。 |
||
307 | * max:750byte |
||
308 | * |
||
309 | * @param string $sellerComments |
||
310 | * @return self |
||
311 | */ |
||
312 | public function setSellerComments(string $sellerComments): self |
||
313 | { |
||
314 | if (isset($this->params['Order']['SellerComments'])) { |
||
315 | throw new LogicException('SellerComments is already set.'); |
||
316 | } |
||
317 | $this->params['Order']['SellerComments'] = $sellerComments; |
||
318 | |||
319 | return $this; |
||
320 | } |
||
321 | |||
322 | /** |
||
323 | * 社内メモ |
||
324 | * ビジネス注文管理ツールでセラーが入力した社内メモです |
||
325 | * max:未定 |
||
326 | * |
||
327 | * @param string $notes |
||
328 | * @return self |
||
329 | */ |
||
330 | View Code Duplication | public function setNotes(string $notes): self |
|
339 | |||
340 | /** |
||
341 | * 返金ステータス |
||
342 | * APIで更新できるのは1:必要から2:返金済みへの更新のみ。 |
||
343 | * |
||
344 | * @param RefundStatus $refundStatus |
||
345 | * @return self |
||
346 | */ |
||
347 | public function setRefundStatus(RefundStatus $refundStatus): self |
||
348 | { |
||
349 | if (isset($this->params['Order']['RefundStatus'])) { |
||
350 | throw new LogicException('RefundStatus is already set.'); |
||
351 | } |
||
352 | $this->params['Order']['RefundStatus'] = $refundStatus->getValue(); |
||
353 | |||
354 | return $this; |
||
355 | } |
||
356 | |||
357 | /** |
||
358 | * @param \DateTimeImmutable $payDate |
||
359 | * @return self |
||
360 | * @internal param \DateTimeImmutable $printBillTime |
||
361 | */ |
||
362 | View Code Duplication | public function setPayDate(\DateTimeImmutable $payDate): self |
|
371 | |||
372 | /** |
||
373 | * 入金処理備考 |
||
374 | * max:1000byte |
||
375 | * |
||
376 | * @param string $payNotes |
||
377 | * @return self |
||
378 | */ |
||
379 | public function setPayNotes(string $payNotes): self |
||
388 | |||
389 | /** |
||
390 | * 代金支払い管理注文期限日時 |
||
391 | * format:YYYYMMDD |
||
392 | * |
||
393 | * @param \DateTimeImmutable $payManageLimitDate |
||
394 | * @return self |
||
395 | * @internal param \DateTimeImmutable $printBillTime |
||
396 | */ |
||
397 | View Code Duplication | public function setPayManageLimitDate(\DateTimeImmutable $payManageLimitDate): self |
|
406 | |||
407 | /** |
||
408 | * 請求書有無 |
||
409 | * 伝票画面上では、「納品書」表記です。 |
||
410 | * 帳票出力でも「納品書」出力で、「明細書」が出力可能です。 |
||
411 | * キーなし : カートに設定なし |
||
412 | * false : 領袖書不要 |
||
413 | * true : 領袖書必要 |
||
414 | * |
||
415 | * @param bool|string $needBillSlip |
||
416 | * @return self |
||
417 | */ |
||
418 | public function setNeedBillSlip(bool $needBillSlip): self |
||
427 | |||
428 | /** |
||
429 | * 明細書有無 |
||
430 | * キーなし : カートに設定なし |
||
431 | * false : 領袖書不要 |
||
432 | * true : 領袖書必要 |
||
433 | * |
||
434 | * @param bool|string $needDetailedSlip |
||
435 | * @return self |
||
436 | */ |
||
437 | public function setNeedDetailedSlip(bool $needDetailedSlip): self |
||
446 | |||
447 | /** |
||
448 | * 領収書有無 |
||
449 | * キーなし : カートに設定なし |
||
450 | * false : 領袖書不要 |
||
451 | * true : 領袖書必要 |
||
452 | * |
||
453 | * @param bool|string $needReceipt |
||
454 | * @return self |
||
455 | */ |
||
456 | public function setNeedReceipt(bool $needReceipt): self |
||
465 | |||
466 | /** |
||
467 | * ご請求先名前 |
||
468 | * max:297byte |
||
469 | * |
||
470 | * @param string $billFirstName |
||
471 | * @return self |
||
472 | */ |
||
473 | public function setBillFirstName(string $billFirstName): self |
||
482 | |||
483 | /** |
||
484 | * ご請求先名前(フリガナ) |
||
485 | * max:297byte |
||
486 | * |
||
487 | * @param string $billFirstnameKana |
||
488 | * @return self |
||
489 | */ |
||
490 | public function setBillFirstnameKana(string $billFirstnameKana): self |
||
499 | |||
500 | /** |
||
501 | * ご請求先名字 |
||
502 | * max:297byte |
||
503 | * |
||
504 | * @param string $billLastName |
||
505 | * @return self |
||
506 | */ |
||
507 | public function setBillLastName(string $billLastName): self |
||
516 | |||
517 | /** |
||
518 | * ご請求先名字(フリガナ) |
||
519 | * max:297byte |
||
520 | * |
||
521 | * @param string $billLastNameKana |
||
522 | * @return self |
||
523 | */ |
||
524 | public function setBillLastNameKana(string $billLastNameKana): self |
||
533 | |||
534 | /** |
||
535 | * ご請求先郵便番号 |
||
536 | * max:10byte |
||
537 | * |
||
538 | * @param string $billZipCode |
||
539 | * @return self |
||
540 | */ |
||
541 | public function setBillZipCode(string $billZipCode): self |
||
550 | |||
551 | /** |
||
552 | * ご請求先都道府県 |
||
553 | * 海外の場合「その他」が入ります。 |
||
554 | * max:12byte |
||
555 | * |
||
556 | * @param string $billPrefecture |
||
557 | * @return self |
||
558 | */ |
||
559 | public function setBillPrefecture(string $billPrefecture): self |
||
568 | |||
569 | /** |
||
570 | * ご請求先都道府県フリガナ |
||
571 | * max:18byte |
||
572 | * |
||
573 | * @param string $billPrefectureKana |
||
574 | * @return self |
||
575 | */ |
||
576 | public function setBillPrefectureKana(string $billPrefectureKana): self |
||
585 | |||
586 | /** |
||
587 | * ご請求先市区郡 |
||
588 | * max:297byte |
||
589 | * |
||
590 | * @param string $billCity |
||
591 | * @return self |
||
592 | */ |
||
593 | public function setBillCity(string $billCity): self |
||
602 | |||
603 | /** |
||
604 | * ご請求先市区郡フリガナ |
||
605 | * max:297byte |
||
606 | * |
||
607 | * @param string $billCityKana |
||
608 | * @return self |
||
609 | */ |
||
610 | public function setBillCityKana(string $billCityKana): self |
||
619 | |||
620 | /** |
||
621 | * ご請求先住所引用元 |
||
622 | * |
||
623 | * @param BillAddressFrom $billAddressFrom |
||
624 | * @return self |
||
625 | */ |
||
626 | View Code Duplication | public function setBillAddressFrom(BillAddressFrom $billAddressFrom): self |
|
635 | |||
636 | /** |
||
637 | * ご請求先住所1 |
||
638 | * max:297byte |
||
639 | * |
||
640 | * @param string $billAddress1 |
||
641 | * @return self |
||
642 | */ |
||
643 | public function setBillAddress1(string $billAddress1): self |
||
652 | |||
653 | /** |
||
654 | * ご請求先住所1フリガナ |
||
655 | * max:297byte |
||
656 | * |
||
657 | * @param string $billAddress1Kana |
||
658 | * @return self |
||
659 | */ |
||
660 | public function setBillAddress1Kana(string $billAddress1Kana): self |
||
669 | |||
670 | /** |
||
671 | * ご請求先住所2 |
||
672 | * max:297byte |
||
673 | * |
||
674 | * @param string $billAddress2 |
||
675 | * @return self |
||
676 | */ |
||
677 | public function setBillAddress2(string $billAddress2): self |
||
686 | |||
687 | /** |
||
688 | * ご請求先住所2フリガナ |
||
689 | * max:297byte |
||
690 | * |
||
691 | * @param string $billAddress2Kana |
||
692 | * @return self |
||
693 | */ |
||
694 | public function setBillAddress2Kana(string $billAddress2Kana): self |
||
703 | |||
704 | /** |
||
705 | * ご請求先電話番号 |
||
706 | * max:14byte |
||
707 | * |
||
708 | * @param string $billPhoneNumber |
||
709 | * @return self |
||
710 | */ |
||
711 | public function setBillPhoneNumber(string $billPhoneNumber): self |
||
720 | |||
721 | /** |
||
722 | * ご請求先電話番号(緊急) |
||
723 | * max:14byte |
||
724 | * |
||
725 | * @param string $billEmgPhoneNumber |
||
726 | * @return self |
||
727 | */ |
||
728 | public function setBillEmgPhoneNumber(string $billEmgPhoneNumber): self |
||
737 | |||
738 | /** |
||
739 | * ご請求先メールアドレス |
||
740 | * バイヤーの入力したメールアドレスです。 |
||
741 | * Wallet利用の場合でかつ追加メールアドレス欄に入力がある場合は追加メールアドレスを入れます。 |
||
742 | * max:99length |
||
743 | * |
||
744 | * @param string $billMailAddress |
||
745 | * @return self |
||
746 | */ |
||
747 | public function setBillMailAddress(string $billMailAddress): self |
||
756 | |||
757 | /** |
||
758 | * ご請求先所属1フィールド名 |
||
759 | * max:297byte |
||
760 | * |
||
761 | * @param string $billSection1Field |
||
762 | * @return self |
||
763 | */ |
||
764 | public function setBillSection1Field(string $billSection1Field): self |
||
773 | |||
774 | /** |
||
775 | * ご請求先所属1入力情報 |
||
776 | * max:297byte |
||
777 | * |
||
778 | * @param string $billSection1Value |
||
779 | * @return self |
||
780 | */ |
||
781 | public function setBillSection1Value(string $billSection1Value): self |
||
790 | |||
791 | /** |
||
792 | * ご請求先所属2フィールド名 |
||
793 | * max:297byte |
||
794 | * |
||
795 | * @param string $billSection2Field |
||
796 | * @return self |
||
797 | */ |
||
798 | public function setBillSection2Field(string $billSection2Field): self |
||
807 | |||
808 | /** |
||
809 | * ご請求先所属2入力情報 |
||
810 | * max:297byte |
||
811 | * |
||
812 | * @param string $billSection2Value |
||
813 | * @return self |
||
814 | */ |
||
815 | public function setBillSection2Value(string $billSection2Value): self |
||
824 | |||
825 | /** |
||
826 | * 配送方法 |
||
827 | * |
||
828 | * @param ShipMethod $shipMethod |
||
829 | * @return self |
||
830 | */ |
||
831 | View Code Duplication | public function setShipMethod(ShipMethod $shipMethod): self |
|
840 | |||
841 | /** |
||
842 | * 配送方法名称 |
||
843 | * ヤマト運輸など、お届け方法名称です。 |
||
844 | * Keyと名称のセットはセラー登録次第なのでセラー毎に違います。 |
||
845 | * max:297byte |
||
846 | * |
||
847 | * @param string $shipMethodName |
||
848 | * @return self |
||
849 | */ |
||
850 | public function setShipMethodName(string $shipMethodName): self |
||
859 | |||
860 | /** |
||
861 | * 配送希望日 |
||
862 | * 注文管理で利用します(検索など)。 |
||
863 | * FEツールでは、Null=お届け希望日なし、あすつくFLGあったらあすつく希望などです。 |
||
864 | * format:YYYYMMDD |
||
865 | * |
||
866 | * @param \DateTimeImmutable $shipRequestDate |
||
867 | * @return self |
||
868 | */ |
||
869 | View Code Duplication | public function setShipRequestDate(\DateTimeImmutable $shipRequestDate): self |
|
878 | |||
879 | /** |
||
880 | * 配送希望時間 |
||
881 | * 12:00~14:00などです。 |
||
882 | * max:13byte |
||
883 | * |
||
884 | * @param string $shipRequestTime |
||
885 | * @return self |
||
886 | */ |
||
887 | public function setShipRequestTime(string $shipRequestTime): self |
||
896 | |||
897 | /** |
||
898 | * 配送メモ |
||
899 | * 注文管理ツールで入力された出荷の配送希望メモ入力内容です。 |
||
900 | * max:500byte |
||
901 | * |
||
902 | * @param string $shipNotes |
||
903 | * @return self |
||
904 | */ |
||
905 | public function setShipNotes(string $shipNotes): self |
||
914 | |||
915 | /** |
||
916 | * 配送伝票番号1 |
||
917 | * 注文管理ツールでセラーが入力、アップロードした配送会社の配送伝票番号です。注文管理ツールの画面上は1と2があります。 |
||
918 | * max:30byte |
||
919 | * |
||
920 | * @param string $shipInvoiceNumber1 |
||
921 | * @return self |
||
922 | */ |
||
923 | public function setShipInvoiceNumber1(string $shipInvoiceNumber1): self |
||
924 | { |
||
925 | if (isset($this->params['Ship']['ShipInvoiceNumber1'])) { |
||
926 | throw new LogicException('ShipInvoiceNumber1 is already set.'); |
||
927 | } |
||
928 | $this->params['Ship']['ShipInvoiceNumber1'] = $shipInvoiceNumber1; |
||
929 | |||
930 | return $this; |
||
931 | } |
||
932 | |||
933 | /** |
||
934 | * 配送伝票番号2 |
||
935 | * 注文管理ツールでセラーが入力、アップロードした配送会社の配送伝票番号です。注文管理ツールの画面上は1と2があります。 |
||
936 | * max:30byte |
||
937 | * |
||
938 | * @param string $shipInvoiceNumber2 |
||
939 | * @return self |
||
940 | */ |
||
941 | public function setShipInvoiceNumber2(string $shipInvoiceNumber2): self |
||
942 | { |
||
943 | if (isset($this->params['Ship']['ShipInvoiceNumber2'])) { |
||
944 | throw new LogicException('ShipInvoiceNumber2 is already set.'); |
||
945 | } |
||
946 | $this->params['Ship']['ShipInvoiceNumber2'] = $shipInvoiceNumber2; |
||
947 | |||
948 | return $this; |
||
949 | } |
||
950 | |||
951 | /** |
||
952 | * 配送会社URL |
||
953 | * アップロードした配送会社の配送伝票番号です. |
||
954 | * max:100byte |
||
955 | * |
||
956 | * @param string $shipUrl |
||
957 | * @return self |
||
958 | */ |
||
959 | public function setShipUrl(string $shipUrl): self |
||
968 | |||
969 | /** |
||
970 | * きょうつく、あすつく |
||
971 | * きょうつく注文、あすつく注文の場合設定 |
||
972 | * |
||
973 | * @param ArriveType $arriveType |
||
974 | * @return self |
||
975 | */ |
||
976 | View Code Duplication | public function setArriveType(ArriveType $arriveType): self |
|
985 | |||
986 | /** |
||
987 | * 出荷日 |
||
988 | * 注文管理ツールで入力された出荷日です。 |
||
989 | * format:YYYYMMDD |
||
990 | * |
||
991 | * @param \DateTimeImmutable $shipDate |
||
992 | * @return self |
||
993 | */ |
||
994 | View Code Duplication | public function setShipDate(\DateTimeImmutable $shipDate): self |
|
1003 | |||
1004 | /** |
||
1005 | * 出荷日 |
||
1006 | * 注文管理ツールで入力された出荷日です。 |
||
1007 | * format:YYYYMMDD |
||
1008 | * |
||
1009 | * @param \DateTimeImmutable $arrivalDate |
||
1010 | * @return self |
||
1011 | */ |
||
1012 | View Code Duplication | public function setArrivalDate(\DateTimeImmutable $arrivalDate): self |
|
1021 | |||
1022 | /** |
||
1023 | * ギフト包装有無 |
||
1024 | * ※モバイル支払いの場合、ギフト包装の変更はできません。 |
||
1025 | * キーなし : カートに設定なし |
||
1026 | * false : ギフト包装無し |
||
1027 | * true : ギフト包装有り |
||
1028 | * max:5byte |
||
1029 | * |
||
1030 | * @param bool $needGiftWrap |
||
1031 | * @return self |
||
1032 | */ |
||
1033 | public function setNeedGiftWrap(bool $needGiftWrap): self |
||
1042 | |||
1043 | /** |
||
1044 | * ギフト包装の種類 |
||
1045 | * max:30byte |
||
1046 | * |
||
1047 | * @param string $giftWrapType |
||
1048 | * @return self |
||
1049 | */ |
||
1050 | public function setGiftWrapType(string $giftWrapType): self |
||
1059 | |||
1060 | /** |
||
1061 | * ギフトメッセージ |
||
1062 | * max:297byte |
||
1063 | * |
||
1064 | * @param string $giftWrapMessage |
||
1065 | * @return self |
||
1066 | */ |
||
1067 | public function setGiftWrapMessage(string $giftWrapMessage): self |
||
1076 | |||
1077 | /** |
||
1078 | * のしの有無 |
||
1079 | * キーなし : カートに設定なし |
||
1080 | * false : のし無し |
||
1081 | * true : のし有り |
||
1082 | * |
||
1083 | * @param bool $needGiftWrapPaper |
||
1084 | * @return self |
||
1085 | */ |
||
1086 | public function setNeedGiftWrapPaper(bool $needGiftWrapPaper): self |
||
1095 | |||
1096 | /** |
||
1097 | * のし種類 |
||
1098 | * max:30byte |
||
1099 | * |
||
1100 | * @param string $giftWrapPaperType |
||
1101 | * @return self |
||
1102 | */ |
||
1103 | public function setGiftWrapPaperType(string $giftWrapPaperType): self |
||
1112 | |||
1113 | /** |
||
1114 | * 名入れ(メッセージ) |
||
1115 | * max:297byte |
||
1116 | * |
||
1117 | * @param string $giftWrapName |
||
1118 | * @return self |
||
1119 | */ |
||
1120 | public function setGiftWrapName(string $giftWrapName): self |
||
1129 | |||
1130 | /** |
||
1131 | * お届け先名前 |
||
1132 | * max:297byte |
||
1133 | * |
||
1134 | * @param string $shipFirstName |
||
1135 | * @return self |
||
1136 | */ |
||
1137 | public function setShipFirstName(string $shipFirstName): self |
||
1146 | |||
1147 | /** |
||
1148 | * お届け先名前 |
||
1149 | * max:297byte |
||
1150 | * |
||
1151 | * @param string $shipFirstNameKana |
||
1152 | * @return self |
||
1153 | */ |
||
1154 | public function setShipFirstNameKana(string $shipFirstNameKana): self |
||
1163 | |||
1164 | /** |
||
1165 | * お届け先名字 |
||
1166 | * max:297byte |
||
1167 | * |
||
1168 | * @param string $shipLastName |
||
1169 | * @return self |
||
1170 | */ |
||
1171 | public function setShipLastName(string $shipLastName): self |
||
1180 | |||
1181 | /** |
||
1182 | * お届け先名字カナ |
||
1183 | * max:297byte |
||
1184 | * |
||
1185 | * @param string $shipLastNameKana |
||
1186 | * @return self |
||
1187 | */ |
||
1188 | public function setShipLastNameKana(string $shipLastNameKana): self |
||
1197 | |||
1198 | /** |
||
1199 | * お届け先郵便番号 |
||
1200 | * max:10byte |
||
1201 | * |
||
1202 | * @param string $shipZipCode |
||
1203 | * @return self |
||
1204 | */ |
||
1205 | public function setShipZipCode(string $shipZipCode): self |
||
1214 | |||
1215 | /** |
||
1216 | * お届け先都道府県 |
||
1217 | * 海外の場合は「その他」として保存します。 |
||
1218 | * max:12byte |
||
1219 | * |
||
1220 | * @param string $shipPrefecture |
||
1221 | * @return self |
||
1222 | */ |
||
1223 | public function setShipPrefecture(string $shipPrefecture): self |
||
1232 | |||
1233 | /** |
||
1234 | * お届け先都道府県フリガナ |
||
1235 | * max:18byte |
||
1236 | * |
||
1237 | * @param string $shipPrefectureKana |
||
1238 | * @return self |
||
1239 | */ |
||
1240 | public function setShipPrefectureKana(string $shipPrefectureKana): self |
||
1249 | |||
1250 | /** |
||
1251 | * お届け先市区郡 |
||
1252 | * max:297byte |
||
1253 | * |
||
1254 | * @param string $shipCity |
||
1255 | * @return self |
||
1256 | */ |
||
1257 | public function setShipCity(string $shipCity): self |
||
1266 | |||
1267 | /** |
||
1268 | * お届け先市区郡フリガナ |
||
1269 | * max:297byte |
||
1270 | * |
||
1271 | * @param string $shipCityKana |
||
1272 | * @return self |
||
1273 | */ |
||
1274 | public function setShipCityKana(string $shipCityKana): self |
||
1283 | |||
1284 | /** |
||
1285 | * お届け先住所1 |
||
1286 | * max:297byte |
||
1287 | * |
||
1288 | * @param string $shipAddress1 |
||
1289 | * @return self |
||
1290 | */ |
||
1291 | public function setShipAddress1(string $shipAddress1): self |
||
1300 | |||
1301 | /** |
||
1302 | * お届け先住所1フリガナ |
||
1303 | * max:297byte |
||
1304 | * |
||
1305 | * @param string $shipAddress1Kana |
||
1306 | * @return self |
||
1307 | */ |
||
1308 | public function setShipAddress1Kana(string $shipAddress1Kana): self |
||
1317 | |||
1318 | /** |
||
1319 | * お届け先住所2 |
||
1320 | * max:297byte |
||
1321 | * |
||
1322 | * @param string $shipAddress2 |
||
1323 | * @return self |
||
1324 | */ |
||
1325 | public function setShipAddress2(string $shipAddress2): self |
||
1334 | |||
1335 | /** |
||
1336 | * お届け先住所2フリガナ |
||
1337 | * max:297byte |
||
1338 | * |
||
1339 | * @param string $shipAddress2Kana |
||
1340 | * @return self |
||
1341 | */ |
||
1342 | public function setShipAddress2Kana(string $shipAddress2Kana): self |
||
1351 | |||
1352 | /** |
||
1353 | * お届け先電話番号 |
||
1354 | * max:14byte |
||
1355 | * |
||
1356 | * @param string $shipPhoneNumber |
||
1357 | * @return self |
||
1358 | */ |
||
1359 | public function setShipPhoneNumber(string $shipPhoneNumber): self |
||
1368 | |||
1369 | /** |
||
1370 | * お届け先緊急連絡先 |
||
1371 | * max:14byte |
||
1372 | * |
||
1373 | * @param string $shipEmgPhoneNumber |
||
1374 | * @return self |
||
1375 | */ |
||
1376 | public function setShipEmgPhoneNumber(string $shipEmgPhoneNumber): self |
||
1385 | |||
1386 | /** |
||
1387 | * お届け先所属1フィールド名 |
||
1388 | * max:297byte |
||
1389 | * |
||
1390 | * @param string $shipSection1Field |
||
1391 | * @return self |
||
1392 | */ |
||
1393 | public function setShipSection1Field(string $shipSection1Field): self |
||
1402 | |||
1403 | /** |
||
1404 | * お届け先所属1入力情報 |
||
1405 | * max:297byte |
||
1406 | * |
||
1407 | * @param string $shipSection1Value |
||
1408 | * @return self |
||
1409 | */ |
||
1410 | public function setShipSection1Value(string $shipSection1Value): self |
||
1419 | |||
1420 | /** |
||
1421 | * お届け先所属2フィールド名 |
||
1422 | * max:297byte |
||
1423 | * |
||
1424 | * @param string $shipSection2Field |
||
1425 | * @return self |
||
1426 | */ |
||
1427 | public function setShipSection2Field(string $shipSection2Field): self |
||
1436 | |||
1437 | /** |
||
1438 | * お届け先所属2入力情報 |
||
1439 | * max:297byte |
||
1440 | * |
||
1441 | * @param string $shipSection2Value |
||
1442 | * @return self |
||
1443 | */ |
||
1444 | public function setShipSection2Value(string $shipSection2Value): self |
||
1453 | |||
1454 | /** |
||
1455 | * 手数料 |
||
1456 | * セラーが設定した手数料(代引き手数料など)、Yahoo!決済の決済手数料は別です。 |
||
1457 | * max:10byte |
||
1458 | * |
||
1459 | * @param string $payCharge |
||
1460 | * @return self |
||
1461 | */ |
||
1462 | View Code Duplication | public function setPayCharge(string $payCharge): self |
|
1471 | |||
1472 | /** |
||
1473 | * 送料 |
||
1474 | * max:10byte |
||
1475 | * |
||
1476 | * @param string $shipCharge |
||
1477 | * @return self |
||
1478 | */ |
||
1479 | View Code Duplication | public function setShipCharge(string $shipCharge): self |
|
1488 | |||
1489 | /** |
||
1490 | * ギフト包装料 |
||
1491 | * max:10byte |
||
1492 | * |
||
1493 | * @param string $giftWrapCharge |
||
1494 | * @return self |
||
1495 | */ |
||
1496 | View Code Duplication | public function setGiftWrapCharge(string $giftWrapCharge): self |
|
1505 | |||
1506 | /** |
||
1507 | * 値引き |
||
1508 | * max:10byte |
||
1509 | * |
||
1510 | * @param string $discount |
||
1511 | * @return self |
||
1512 | */ |
||
1513 | View Code Duplication | public function setDiscount(string $discount): self |
|
1522 | |||
1523 | /** |
||
1524 | * 調整額 |
||
1525 | * マイナスの値も許容、その場合は -(10byte) が許容最大 |
||
1526 | * max:10byte |
||
1527 | * |
||
1528 | * @param string $adjustments |
||
1529 | * @return self |
||
1530 | */ |
||
1531 | View Code Duplication | public function setAdjustments(string $adjustments): self |
|
1540 | |||
1541 | /** |
||
1542 | * 商品LineID |
||
1543 | * 商品情報を更新する際は必須です。 |
||
1544 | * |
||
1545 | * @param string $lineId |
||
1546 | * @return self |
||
1547 | */ |
||
1548 | public function setLineId(string $lineId): self |
||
1557 | |||
1558 | /** |
||
1559 | * 商品ごとの数量 |
||
1560 | * max:3byte |
||
1561 | * |
||
1562 | * @param string $quantity |
||
1563 | * @return self |
||
1564 | */ |
||
1565 | public function setQuantity(string $quantity): self |
||
1574 | |||
1575 | /** |
||
1576 | * 発売日 |
||
1577 | * 発売日の入力がある場合です。 |
||
1578 | * 発売日>注文日の場合、予約注文として扱います。 |
||
1579 | * format:YYYYMMDD |
||
1580 | * |
||
1581 | * @param \DateTimeImmutable $releaseDate |
||
1582 | * @return self |
||
1583 | */ |
||
1584 | View Code Duplication | public function setReleaseDate(\DateTimeImmutable $releaseDate): self |
|
1593 | |||
1594 | } |
||
1595 |
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.