Complex classes like Payment 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 Payment, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 9 | class Payment |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var string |
||
| 13 | */ |
||
| 14 | protected $apiKey; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $merchant; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var int |
||
| 23 | */ |
||
| 24 | protected $orderId; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $sessionId; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $currencySymbol; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var Money |
||
| 38 | */ |
||
| 39 | protected $totalAmount; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | protected $callBackUrl; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @var string |
||
| 48 | */ |
||
| 49 | protected $fullCallBackOkUrl; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @var string |
||
| 53 | */ |
||
| 54 | protected $callBackOkUrl; |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @var string |
||
| 58 | */ |
||
| 59 | protected $callBackServerUrl; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @var int |
||
| 63 | */ |
||
| 64 | protected $languageId; |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @var bool |
||
| 68 | */ |
||
| 69 | protected $testMode; |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @var int |
||
| 73 | */ |
||
| 74 | protected $paymentGatewayCurrencyCode; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var int |
||
| 78 | */ |
||
| 79 | protected $cardTypeId; |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @var string |
||
| 83 | */ |
||
| 84 | protected $customerRekvNr; |
||
| 85 | |||
| 86 | /** |
||
| 87 | * @var string |
||
| 88 | */ |
||
| 89 | protected $customerName; |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @var string |
||
| 93 | */ |
||
| 94 | protected $customerCompany; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * @var string |
||
| 98 | */ |
||
| 99 | protected $customerAddress; |
||
| 100 | |||
| 101 | /** |
||
| 102 | * @var string |
||
| 103 | */ |
||
| 104 | protected $customerAddress2; |
||
| 105 | |||
| 106 | /** |
||
| 107 | * @var string |
||
| 108 | */ |
||
| 109 | protected $customerZipCode; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @var string |
||
| 113 | */ |
||
| 114 | protected $customerCity; |
||
| 115 | |||
| 116 | /** |
||
| 117 | * @var int |
||
| 118 | */ |
||
| 119 | protected $customerCountryId; |
||
| 120 | |||
| 121 | /** |
||
| 122 | * @var string |
||
| 123 | */ |
||
| 124 | protected $customerCountry; |
||
| 125 | |||
| 126 | /** |
||
| 127 | * @var string |
||
| 128 | */ |
||
| 129 | protected $customerPhone; |
||
| 130 | |||
| 131 | /** |
||
| 132 | * @var string |
||
| 133 | */ |
||
| 134 | protected $customerFax; |
||
| 135 | |||
| 136 | /** |
||
| 137 | * @var string |
||
| 138 | */ |
||
| 139 | protected $customerEmail; |
||
| 140 | |||
| 141 | /** |
||
| 142 | * @var string |
||
| 143 | */ |
||
| 144 | protected $customerNote; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * @var string |
||
| 148 | */ |
||
| 149 | protected $customerCvrnr; |
||
| 150 | |||
| 151 | /** |
||
| 152 | * @var int |
||
| 153 | */ |
||
| 154 | protected $customerCustTypeId; |
||
| 155 | |||
| 156 | /** |
||
| 157 | * @var string |
||
| 158 | */ |
||
| 159 | protected $customerEan; |
||
| 160 | |||
| 161 | /** |
||
| 162 | * @var string |
||
| 163 | */ |
||
| 164 | protected $customerRes1; |
||
| 165 | |||
| 166 | /** |
||
| 167 | * @var string |
||
| 168 | */ |
||
| 169 | protected $customerRes2; |
||
| 170 | |||
| 171 | /** |
||
| 172 | * @var string |
||
| 173 | */ |
||
| 174 | protected $customerRes3; |
||
| 175 | |||
| 176 | /** |
||
| 177 | * @var string |
||
| 178 | */ |
||
| 179 | protected $customerRes4; |
||
| 180 | |||
| 181 | /** |
||
| 182 | * @var string |
||
| 183 | */ |
||
| 184 | protected $customerRes5; |
||
| 185 | |||
| 186 | /** |
||
| 187 | * @var string |
||
| 188 | */ |
||
| 189 | protected $customerIp; |
||
| 190 | |||
| 191 | /** |
||
| 192 | * @var string |
||
| 193 | */ |
||
| 194 | protected $deliveryName; |
||
| 195 | |||
| 196 | /** |
||
| 197 | * @var string |
||
| 198 | */ |
||
| 199 | protected $deliveryCompany; |
||
| 200 | |||
| 201 | /** |
||
| 202 | * @var string |
||
| 203 | */ |
||
| 204 | protected $deliveryAddress; |
||
| 205 | |||
| 206 | /** |
||
| 207 | * @var string |
||
| 208 | */ |
||
| 209 | protected $deliveryAddress2; |
||
| 210 | |||
| 211 | /** |
||
| 212 | * @var string |
||
| 213 | */ |
||
| 214 | protected $deliveryZipCode; |
||
| 215 | |||
| 216 | /** |
||
| 217 | * @var string |
||
| 218 | */ |
||
| 219 | protected $deliveryCity; |
||
| 220 | |||
| 221 | /** |
||
| 222 | * @var int |
||
| 223 | */ |
||
| 224 | protected $deliveryCountryID; |
||
| 225 | |||
| 226 | /** |
||
| 227 | * @var string |
||
| 228 | */ |
||
| 229 | protected $deliveryCountry; |
||
| 230 | |||
| 231 | /** |
||
| 232 | * @var string |
||
| 233 | */ |
||
| 234 | protected $deliveryPhone; |
||
| 235 | |||
| 236 | /** |
||
| 237 | * @var string |
||
| 238 | */ |
||
| 239 | protected $deliveryFax; |
||
| 240 | |||
| 241 | /** |
||
| 242 | * @var string |
||
| 243 | */ |
||
| 244 | protected $deliveryEmail; |
||
| 245 | |||
| 246 | /** |
||
| 247 | * @var string |
||
| 248 | */ |
||
| 249 | protected $deliveryEan; |
||
| 250 | |||
| 251 | /** |
||
| 252 | * @var string |
||
| 253 | */ |
||
| 254 | protected $shippingMethod; |
||
| 255 | |||
| 256 | /** |
||
| 257 | * @var int |
||
| 258 | */ |
||
| 259 | protected $shippingMethodId; |
||
| 260 | |||
| 261 | /** |
||
| 262 | * @var Money |
||
| 263 | */ |
||
| 264 | protected $shippingFee; |
||
| 265 | |||
| 266 | /** |
||
| 267 | * @var string |
||
| 268 | */ |
||
| 269 | protected $paymentMethod; |
||
| 270 | |||
| 271 | /** |
||
| 272 | * @var int |
||
| 273 | */ |
||
| 274 | protected $paymentMethodId; |
||
| 275 | |||
| 276 | /** |
||
| 277 | * @var Money |
||
| 278 | */ |
||
| 279 | protected $paymentFee; |
||
| 280 | |||
| 281 | /** |
||
| 282 | * @var string |
||
| 283 | */ |
||
| 284 | protected $loadBalancerRealIp; |
||
| 285 | |||
| 286 | /** |
||
| 287 | * @var string |
||
| 288 | */ |
||
| 289 | protected $referrer; |
||
| 290 | |||
| 291 | /** |
||
| 292 | * @var PaymentLine[] |
||
| 293 | */ |
||
| 294 | protected $paymentLines; |
||
| 295 | |||
| 296 | 18 | public function __construct() |
|
| 300 | |||
| 301 | 6 | public static function createFromRequest(ServerRequestInterface $request) : Payment |
|
| 307 | |||
| 308 | 6 | public function populateFromRequest(ServerRequestInterface $request) |
|
| 398 | |||
| 399 | 3 | public static function createPaymentLine(string $productNumber, string $name, int $quantity, Money $price, int $vat) |
|
| 403 | |||
| 404 | /** |
||
| 405 | * Takes strings like |
||
| 406 | * - 1.000,50 |
||
| 407 | * - 1,000.50 |
||
| 408 | * - 1000.50 |
||
| 409 | * - 1000,50. |
||
| 410 | * |
||
| 411 | * and returns 100050 |
||
| 412 | * |
||
| 413 | * @param string $str |
||
| 414 | * @param string $propertyPath |
||
| 415 | * |
||
| 416 | * @return int |
||
| 417 | */ |
||
| 418 | 9 | public static function priceStringToInt(string $str, string $propertyPath = '') : int |
|
| 431 | |||
| 432 | /** |
||
| 433 | * @return string |
||
| 434 | */ |
||
| 435 | 6 | public function getApiKey(): ?string |
|
| 439 | |||
| 440 | /** |
||
| 441 | * @param string $apiKey |
||
| 442 | * |
||
| 443 | * @return Payment |
||
| 444 | */ |
||
| 445 | 9 | public function setApiKey(string $apiKey): self |
|
| 451 | |||
| 452 | /** |
||
| 453 | * @return string |
||
| 454 | */ |
||
| 455 | 3 | public function getMerchant(): ?string |
|
| 459 | |||
| 460 | /** |
||
| 461 | * @param string $merchant |
||
| 462 | * |
||
| 463 | * @return Payment |
||
| 464 | */ |
||
| 465 | 6 | public function setMerchant(string $merchant): self |
|
| 471 | |||
| 472 | /** |
||
| 473 | * @return int |
||
| 474 | */ |
||
| 475 | 9 | public function getOrderId(): ?int |
|
| 479 | |||
| 480 | /** |
||
| 481 | * @param int $orderId |
||
| 482 | * |
||
| 483 | * @return Payment |
||
| 484 | */ |
||
| 485 | 12 | public function setOrderId(int $orderId): self |
|
| 491 | |||
| 492 | /** |
||
| 493 | * @return string |
||
| 494 | */ |
||
| 495 | 3 | public function getSessionId(): ?string |
|
| 499 | |||
| 500 | /** |
||
| 501 | * @param string $sessionId |
||
| 502 | * |
||
| 503 | * @return Payment |
||
| 504 | */ |
||
| 505 | 6 | public function setSessionId(string $sessionId): self |
|
| 511 | |||
| 512 | /** |
||
| 513 | * @return string |
||
| 514 | */ |
||
| 515 | 3 | public function getCurrencySymbol(): ?string |
|
| 519 | |||
| 520 | /** |
||
| 521 | * @param string $currencySymbol |
||
| 522 | * |
||
| 523 | * @return Payment |
||
| 524 | */ |
||
| 525 | 6 | public function setCurrencySymbol(string $currencySymbol): self |
|
| 531 | |||
| 532 | /** |
||
| 533 | * @return Money |
||
| 534 | */ |
||
| 535 | 9 | public function getTotalAmount(): ?Money |
|
| 539 | |||
| 540 | /** |
||
| 541 | * @param Money $totalAmount |
||
| 542 | * |
||
| 543 | * @return Payment |
||
| 544 | */ |
||
| 545 | 6 | public function setTotalAmount(Money $totalAmount): self |
|
| 551 | |||
| 552 | /** |
||
| 553 | * @return string |
||
| 554 | */ |
||
| 555 | 3 | public function getCallBackUrl(): ?string |
|
| 559 | |||
| 560 | /** |
||
| 561 | * @param string $callBackUrl |
||
| 562 | * |
||
| 563 | * @return Payment |
||
| 564 | */ |
||
| 565 | 6 | public function setCallBackUrl(string $callBackUrl): self |
|
| 571 | |||
| 572 | /** |
||
| 573 | * @return string |
||
| 574 | */ |
||
| 575 | 3 | public function getFullCallBackOkUrl(): ?string |
|
| 579 | |||
| 580 | /** |
||
| 581 | * @param string $fullCallBackOkUrl |
||
| 582 | * |
||
| 583 | * @return Payment |
||
| 584 | */ |
||
| 585 | 6 | public function setFullCallBackOkUrl(string $fullCallBackOkUrl): self |
|
| 591 | |||
| 592 | /** |
||
| 593 | * @return string |
||
| 594 | */ |
||
| 595 | 3 | public function getCallBackOkUrl(): ?string |
|
| 599 | |||
| 600 | /** |
||
| 601 | * @param string $callBackOkUrl |
||
| 602 | * |
||
| 603 | * @return Payment |
||
| 604 | */ |
||
| 605 | 6 | public function setCallBackOkUrl(string $callBackOkUrl): self |
|
| 611 | |||
| 612 | /** |
||
| 613 | * @return string |
||
| 614 | */ |
||
| 615 | 3 | public function getCallBackServerUrl(): ?string |
|
| 619 | |||
| 620 | /** |
||
| 621 | * @param string $callBackServerUrl |
||
| 622 | * |
||
| 623 | * @return Payment |
||
| 624 | */ |
||
| 625 | 6 | public function setCallBackServerUrl(string $callBackServerUrl): self |
|
| 631 | |||
| 632 | /** |
||
| 633 | * @return int |
||
| 634 | */ |
||
| 635 | 3 | public function getLanguageId(): ?int |
|
| 639 | |||
| 640 | /** |
||
| 641 | * @param int $languageId |
||
| 642 | * |
||
| 643 | * @return Payment |
||
| 644 | */ |
||
| 645 | 6 | public function setLanguageId(int $languageId): self |
|
| 651 | |||
| 652 | /** |
||
| 653 | * @return bool |
||
| 654 | */ |
||
| 655 | 3 | public function isTestMode(): ?bool |
|
| 659 | |||
| 660 | /** |
||
| 661 | * @param bool $testMode |
||
| 662 | * |
||
| 663 | * @return Payment |
||
| 664 | */ |
||
| 665 | 6 | public function setTestMode(bool $testMode): self |
|
| 671 | |||
| 672 | /** |
||
| 673 | * @return int |
||
| 674 | */ |
||
| 675 | 9 | public function getPaymentGatewayCurrencyCode() |
|
| 679 | |||
| 680 | /** |
||
| 681 | * @param int $paymentGatewayCurrencyCode |
||
| 682 | * |
||
| 683 | * @return Payment |
||
| 684 | */ |
||
| 685 | 12 | public function setPaymentGatewayCurrencyCode(int $paymentGatewayCurrencyCode): self |
|
| 691 | |||
| 692 | /** |
||
| 693 | * @return int |
||
| 694 | */ |
||
| 695 | 3 | public function getCardTypeId() |
|
| 699 | |||
| 700 | /** |
||
| 701 | * @param int $cardTypeId |
||
| 702 | * |
||
| 703 | * @return Payment |
||
| 704 | */ |
||
| 705 | 6 | public function setCardTypeId(int $cardTypeId): self |
|
| 711 | |||
| 712 | /** |
||
| 713 | * @return string |
||
| 714 | */ |
||
| 715 | 3 | public function getCustomerRekvNr(): ?string |
|
| 719 | |||
| 720 | /** |
||
| 721 | * @param string $customerRekvNr |
||
| 722 | * |
||
| 723 | * @return Payment |
||
| 724 | */ |
||
| 725 | 6 | public function setCustomerRekvNr(string $customerRekvNr): self |
|
| 731 | |||
| 732 | /** |
||
| 733 | * @return string |
||
| 734 | */ |
||
| 735 | 3 | public function getCustomerName(): ?string |
|
| 739 | |||
| 740 | /** |
||
| 741 | * @param string $customerName |
||
| 742 | * |
||
| 743 | * @return Payment |
||
| 744 | */ |
||
| 745 | 6 | public function setCustomerName(string $customerName): self |
|
| 751 | |||
| 752 | /** |
||
| 753 | * @return string |
||
| 754 | */ |
||
| 755 | 3 | public function getCustomerCompany(): ?string |
|
| 759 | |||
| 760 | /** |
||
| 761 | * @param string $customerCompany |
||
| 762 | * |
||
| 763 | * @return Payment |
||
| 764 | */ |
||
| 765 | 6 | public function setCustomerCompany(string $customerCompany): self |
|
| 771 | |||
| 772 | /** |
||
| 773 | * @return string |
||
| 774 | */ |
||
| 775 | 3 | public function getCustomerAddress(): ?string |
|
| 779 | |||
| 780 | /** |
||
| 781 | * @param string $customerAddress |
||
| 782 | * |
||
| 783 | * @return Payment |
||
| 784 | */ |
||
| 785 | 6 | public function setCustomerAddress(string $customerAddress): self |
|
| 791 | |||
| 792 | /** |
||
| 793 | * @return string |
||
| 794 | */ |
||
| 795 | 3 | public function getCustomerAddress2(): ?string |
|
| 799 | |||
| 800 | /** |
||
| 801 | * @param string $customerAddress2 |
||
| 802 | * |
||
| 803 | * @return Payment |
||
| 804 | */ |
||
| 805 | 6 | public function setCustomerAddress2(string $customerAddress2): self |
|
| 811 | |||
| 812 | /** |
||
| 813 | * @return string |
||
| 814 | */ |
||
| 815 | 3 | public function getCustomerZipCode(): ?string |
|
| 819 | |||
| 820 | /** |
||
| 821 | * @param string $customerZipCode |
||
| 822 | * |
||
| 823 | * @return Payment |
||
| 824 | */ |
||
| 825 | 6 | public function setCustomerZipCode(string $customerZipCode): self |
|
| 831 | |||
| 832 | /** |
||
| 833 | * @return string |
||
| 834 | */ |
||
| 835 | 3 | public function getCustomerCity(): ?string |
|
| 839 | |||
| 840 | /** |
||
| 841 | * @param string $customerCity |
||
| 842 | * |
||
| 843 | * @return Payment |
||
| 844 | */ |
||
| 845 | 6 | public function setCustomerCity(string $customerCity): self |
|
| 851 | |||
| 852 | /** |
||
| 853 | * @return int |
||
| 854 | */ |
||
| 855 | 3 | public function getCustomerCountryId() |
|
| 859 | |||
| 860 | /** |
||
| 861 | * @param int $customerCountryId |
||
| 862 | * |
||
| 863 | * @return Payment |
||
| 864 | */ |
||
| 865 | 6 | public function setCustomerCountryId(int $customerCountryId): self |
|
| 871 | |||
| 872 | /** |
||
| 873 | * @return string |
||
| 874 | */ |
||
| 875 | 3 | public function getCustomerCountry(): ?string |
|
| 879 | |||
| 880 | /** |
||
| 881 | * @param string $customerCountry |
||
| 882 | * |
||
| 883 | * @return Payment |
||
| 884 | */ |
||
| 885 | 6 | public function setCustomerCountry(string $customerCountry): self |
|
| 891 | |||
| 892 | /** |
||
| 893 | * @return string |
||
| 894 | */ |
||
| 895 | 3 | public function getCustomerPhone(): ?string |
|
| 899 | |||
| 900 | /** |
||
| 901 | * @param string $customerPhone |
||
| 902 | * |
||
| 903 | * @return Payment |
||
| 904 | */ |
||
| 905 | 6 | public function setCustomerPhone(string $customerPhone): self |
|
| 911 | |||
| 912 | /** |
||
| 913 | * @return string |
||
| 914 | */ |
||
| 915 | 3 | public function getCustomerFax(): ?string |
|
| 919 | |||
| 920 | /** |
||
| 921 | * @param string $customerFax |
||
| 922 | * |
||
| 923 | * @return Payment |
||
| 924 | */ |
||
| 925 | 6 | public function setCustomerFax(string $customerFax): self |
|
| 931 | |||
| 932 | /** |
||
| 933 | * @return string |
||
| 934 | */ |
||
| 935 | 3 | public function getCustomerEmail(): ?string |
|
| 939 | |||
| 940 | /** |
||
| 941 | * @param string $customerEmail |
||
| 942 | * |
||
| 943 | * @return Payment |
||
| 944 | */ |
||
| 945 | 6 | public function setCustomerEmail(string $customerEmail): self |
|
| 951 | |||
| 952 | /** |
||
| 953 | * @return string |
||
| 954 | */ |
||
| 955 | 3 | public function getCustomerNote(): ?string |
|
| 959 | |||
| 960 | /** |
||
| 961 | * @param string $customerNote |
||
| 962 | * |
||
| 963 | * @return Payment |
||
| 964 | */ |
||
| 965 | 6 | public function setCustomerNote(string $customerNote): self |
|
| 971 | |||
| 972 | /** |
||
| 973 | * @return string |
||
| 974 | */ |
||
| 975 | 3 | public function getCustomerCvrnr(): ?string |
|
| 979 | |||
| 980 | /** |
||
| 981 | * @param string $customerCvrnr |
||
| 982 | * |
||
| 983 | * @return Payment |
||
| 984 | */ |
||
| 985 | 6 | public function setCustomerCvrnr(string $customerCvrnr): self |
|
| 991 | |||
| 992 | /** |
||
| 993 | * @return int |
||
| 994 | */ |
||
| 995 | 3 | public function getCustomerCustTypeId(): ?int |
|
| 999 | |||
| 1000 | /** |
||
| 1001 | * @param int $customerCustTypeId |
||
| 1002 | * |
||
| 1003 | * @return Payment |
||
| 1004 | */ |
||
| 1005 | 6 | public function setCustomerCustTypeId(int $customerCustTypeId): self |
|
| 1011 | |||
| 1012 | /** |
||
| 1013 | * @return string |
||
| 1014 | */ |
||
| 1015 | 3 | public function getCustomerEan(): ?string |
|
| 1019 | |||
| 1020 | /** |
||
| 1021 | * @param string $customerEan |
||
| 1022 | * |
||
| 1023 | * @return Payment |
||
| 1024 | */ |
||
| 1025 | 6 | public function setCustomerEan(string $customerEan): self |
|
| 1031 | |||
| 1032 | /** |
||
| 1033 | * @return string |
||
| 1034 | */ |
||
| 1035 | 3 | public function getCustomerRes1(): ?string |
|
| 1039 | |||
| 1040 | /** |
||
| 1041 | * @param string $customerRes1 |
||
| 1042 | * |
||
| 1043 | * @return Payment |
||
| 1044 | */ |
||
| 1045 | 6 | public function setCustomerRes1(string $customerRes1): self |
|
| 1051 | |||
| 1052 | /** |
||
| 1053 | * @return string |
||
| 1054 | */ |
||
| 1055 | 3 | public function getCustomerRes2(): ?string |
|
| 1059 | |||
| 1060 | /** |
||
| 1061 | * @param string $customerRes2 |
||
| 1062 | * |
||
| 1063 | * @return Payment |
||
| 1064 | */ |
||
| 1065 | 6 | public function setCustomerRes2(string $customerRes2): self |
|
| 1071 | |||
| 1072 | /** |
||
| 1073 | * @return string |
||
| 1074 | */ |
||
| 1075 | 3 | public function getCustomerRes3(): ?string |
|
| 1079 | |||
| 1080 | /** |
||
| 1081 | * @param string $customerRes3 |
||
| 1082 | * |
||
| 1083 | * @return Payment |
||
| 1084 | */ |
||
| 1085 | 6 | public function setCustomerRes3(string $customerRes3): self |
|
| 1091 | |||
| 1092 | /** |
||
| 1093 | * @return string |
||
| 1094 | */ |
||
| 1095 | 3 | public function getCustomerRes4(): ?string |
|
| 1099 | |||
| 1100 | /** |
||
| 1101 | * @param string $customerRes4 |
||
| 1102 | * |
||
| 1103 | * @return Payment |
||
| 1104 | */ |
||
| 1105 | 6 | public function setCustomerRes4(string $customerRes4): self |
|
| 1111 | |||
| 1112 | /** |
||
| 1113 | * @return string |
||
| 1114 | */ |
||
| 1115 | 3 | public function getCustomerRes5(): ?string |
|
| 1119 | |||
| 1120 | /** |
||
| 1121 | * @param string $customerRes5 |
||
| 1122 | * |
||
| 1123 | * @return Payment |
||
| 1124 | */ |
||
| 1125 | 6 | public function setCustomerRes5(string $customerRes5): self |
|
| 1131 | |||
| 1132 | /** |
||
| 1133 | * @return string |
||
| 1134 | */ |
||
| 1135 | 3 | public function getCustomerIp(): ?string |
|
| 1139 | |||
| 1140 | /** |
||
| 1141 | * @param string $customerIp |
||
| 1142 | * |
||
| 1143 | * @return Payment |
||
| 1144 | */ |
||
| 1145 | 6 | public function setCustomerIp(string $customerIp): self |
|
| 1151 | |||
| 1152 | /** |
||
| 1153 | * @return string |
||
| 1154 | */ |
||
| 1155 | 3 | public function getDeliveryName(): ?string |
|
| 1159 | |||
| 1160 | /** |
||
| 1161 | * @param string $deliveryName |
||
| 1162 | * |
||
| 1163 | * @return Payment |
||
| 1164 | */ |
||
| 1165 | 6 | public function setDeliveryName(string $deliveryName): self |
|
| 1171 | |||
| 1172 | /** |
||
| 1173 | * @return string |
||
| 1174 | */ |
||
| 1175 | 3 | public function getDeliveryCompany(): ?string |
|
| 1179 | |||
| 1180 | /** |
||
| 1181 | * @param string $deliveryCompany |
||
| 1182 | * |
||
| 1183 | * @return Payment |
||
| 1184 | */ |
||
| 1185 | 6 | public function setDeliveryCompany(string $deliveryCompany): self |
|
| 1191 | |||
| 1192 | /** |
||
| 1193 | * @return string |
||
| 1194 | */ |
||
| 1195 | 3 | public function getDeliveryAddress(): ?string |
|
| 1199 | |||
| 1200 | /** |
||
| 1201 | * @param string $deliveryAddress |
||
| 1202 | * |
||
| 1203 | * @return Payment |
||
| 1204 | */ |
||
| 1205 | 6 | public function setDeliveryAddress(string $deliveryAddress): self |
|
| 1211 | |||
| 1212 | /** |
||
| 1213 | * @return string |
||
| 1214 | */ |
||
| 1215 | 3 | public function getDeliveryAddress2(): ?string |
|
| 1219 | |||
| 1220 | /** |
||
| 1221 | * @param string $deliveryAddress2 |
||
| 1222 | * |
||
| 1223 | * @return Payment |
||
| 1224 | */ |
||
| 1225 | 6 | public function setDeliveryAddress2(string $deliveryAddress2): self |
|
| 1231 | |||
| 1232 | /** |
||
| 1233 | * @return string |
||
| 1234 | */ |
||
| 1235 | 3 | public function getDeliveryZipCode(): ?string |
|
| 1239 | |||
| 1240 | /** |
||
| 1241 | * @param string $deliveryZipCode |
||
| 1242 | * |
||
| 1243 | * @return Payment |
||
| 1244 | */ |
||
| 1245 | 6 | public function setDeliveryZipCode(string $deliveryZipCode): self |
|
| 1251 | |||
| 1252 | /** |
||
| 1253 | * @return string |
||
| 1254 | */ |
||
| 1255 | 3 | public function getDeliveryCity(): ?string |
|
| 1259 | |||
| 1260 | /** |
||
| 1261 | * @param string $deliveryCity |
||
| 1262 | * |
||
| 1263 | * @return Payment |
||
| 1264 | */ |
||
| 1265 | 6 | public function setDeliveryCity(string $deliveryCity): self |
|
| 1271 | |||
| 1272 | /** |
||
| 1273 | * @return int |
||
| 1274 | */ |
||
| 1275 | 3 | public function getDeliveryCountryID() |
|
| 1279 | |||
| 1280 | /** |
||
| 1281 | * @param int $deliveryCountryID |
||
| 1282 | * |
||
| 1283 | * @return Payment |
||
| 1284 | */ |
||
| 1285 | 6 | public function setDeliveryCountryID(int $deliveryCountryID): self |
|
| 1291 | |||
| 1292 | /** |
||
| 1293 | * @return string |
||
| 1294 | */ |
||
| 1295 | 3 | public function getDeliveryCountry(): ?string |
|
| 1299 | |||
| 1300 | /** |
||
| 1301 | * @param string $deliveryCountry |
||
| 1302 | * |
||
| 1303 | * @return Payment |
||
| 1304 | */ |
||
| 1305 | 6 | public function setDeliveryCountry(string $deliveryCountry): self |
|
| 1311 | |||
| 1312 | /** |
||
| 1313 | * @return string |
||
| 1314 | */ |
||
| 1315 | 3 | public function getDeliveryPhone(): ?string |
|
| 1319 | |||
| 1320 | /** |
||
| 1321 | * @param string $deliveryPhone |
||
| 1322 | * |
||
| 1323 | * @return Payment |
||
| 1324 | */ |
||
| 1325 | 6 | public function setDeliveryPhone(string $deliveryPhone): self |
|
| 1331 | |||
| 1332 | /** |
||
| 1333 | * @return string |
||
| 1334 | */ |
||
| 1335 | 3 | public function getDeliveryFax(): ?string |
|
| 1339 | |||
| 1340 | /** |
||
| 1341 | * @param string $deliveryFax |
||
| 1342 | * |
||
| 1343 | * @return Payment |
||
| 1344 | */ |
||
| 1345 | 6 | public function setDeliveryFax(string $deliveryFax): self |
|
| 1351 | |||
| 1352 | /** |
||
| 1353 | * @return string |
||
| 1354 | */ |
||
| 1355 | 3 | public function getDeliveryEmail(): ?string |
|
| 1359 | |||
| 1360 | /** |
||
| 1361 | * @param string $deliveryEmail |
||
| 1362 | * |
||
| 1363 | * @return Payment |
||
| 1364 | */ |
||
| 1365 | 6 | public function setDeliveryEmail(string $deliveryEmail): self |
|
| 1371 | |||
| 1372 | /** |
||
| 1373 | * @return string |
||
| 1374 | */ |
||
| 1375 | 3 | public function getDeliveryEan(): ?string |
|
| 1379 | |||
| 1380 | /** |
||
| 1381 | * @param string $deliveryEan |
||
| 1382 | * |
||
| 1383 | * @return Payment |
||
| 1384 | */ |
||
| 1385 | 6 | public function setDeliveryEan(string $deliveryEan): self |
|
| 1391 | |||
| 1392 | /** |
||
| 1393 | * @return string |
||
| 1394 | */ |
||
| 1395 | 3 | public function getShippingMethod(): ?string |
|
| 1399 | |||
| 1400 | /** |
||
| 1401 | * @param string $shippingMethod |
||
| 1402 | * |
||
| 1403 | * @return Payment |
||
| 1404 | */ |
||
| 1405 | 6 | public function setShippingMethod(string $shippingMethod): self |
|
| 1411 | |||
| 1412 | /** |
||
| 1413 | * @return int |
||
| 1414 | */ |
||
| 1415 | 3 | public function getShippingMethodId(): ?int |
|
| 1419 | |||
| 1420 | /** |
||
| 1421 | * @param int $shippingMethodId |
||
| 1422 | * @return Payment |
||
| 1423 | */ |
||
| 1424 | 6 | public function setShippingMethodId(int $shippingMethodId) : self |
|
| 1429 | |||
| 1430 | /** |
||
| 1431 | * @return Money |
||
| 1432 | */ |
||
| 1433 | 3 | public function getShippingFee(): ?Money |
|
| 1437 | |||
| 1438 | /** |
||
| 1439 | * @param Money $shippingFee |
||
| 1440 | * |
||
| 1441 | * @return Payment |
||
| 1442 | */ |
||
| 1443 | 3 | public function setShippingFee(Money $shippingFee): self |
|
| 1449 | |||
| 1450 | /** |
||
| 1451 | * @return string |
||
| 1452 | */ |
||
| 1453 | 3 | public function getPaymentMethod(): ?string |
|
| 1457 | |||
| 1458 | /** |
||
| 1459 | * @param string $paymentMethod |
||
| 1460 | * |
||
| 1461 | * @return Payment |
||
| 1462 | */ |
||
| 1463 | 6 | public function setPaymentMethod(string $paymentMethod): self |
|
| 1469 | |||
| 1470 | /** |
||
| 1471 | * @return int |
||
| 1472 | */ |
||
| 1473 | 3 | public function getPaymentMethodId(): ?int |
|
| 1477 | |||
| 1478 | /** |
||
| 1479 | * @param int $paymentMethodId |
||
| 1480 | * @return Payment |
||
| 1481 | */ |
||
| 1482 | 6 | public function setPaymentMethodId(int $paymentMethodId) : self |
|
| 1487 | |||
| 1488 | /** |
||
| 1489 | * @return Money |
||
| 1490 | */ |
||
| 1491 | 3 | public function getPaymentFee(): ?Money |
|
| 1495 | |||
| 1496 | /** |
||
| 1497 | * @param Money $paymentFee |
||
| 1498 | * |
||
| 1499 | * @return Payment |
||
| 1500 | */ |
||
| 1501 | 3 | public function setPaymentFee(Money $paymentFee): self |
|
| 1507 | |||
| 1508 | /** |
||
| 1509 | * @return string |
||
| 1510 | */ |
||
| 1511 | 3 | public function getLoadBalancerRealIp(): ?string |
|
| 1515 | |||
| 1516 | /** |
||
| 1517 | * @param string $loadBalancerRealIp |
||
| 1518 | * |
||
| 1519 | * @return Payment |
||
| 1520 | */ |
||
| 1521 | 6 | public function setLoadBalancerRealIp(string $loadBalancerRealIp): self |
|
| 1527 | |||
| 1528 | /** |
||
| 1529 | * @return string |
||
| 1530 | */ |
||
| 1531 | 3 | public function getReferrer(): ?string |
|
| 1535 | |||
| 1536 | /** |
||
| 1537 | * @param string $referrer |
||
| 1538 | * |
||
| 1539 | * @return Payment |
||
| 1540 | */ |
||
| 1541 | 6 | public function setReferrer(string $referrer): self |
|
| 1547 | |||
| 1548 | /** |
||
| 1549 | * @return PaymentLine[]|iterable |
||
| 1550 | */ |
||
| 1551 | 6 | public function getPaymentLines(): iterable |
|
| 1555 | |||
| 1556 | /** |
||
| 1557 | * @param PaymentLine[]|iterable $paymentLines |
||
| 1558 | * |
||
| 1559 | * @return Payment |
||
| 1560 | */ |
||
| 1561 | 3 | public function setPaymentLines(iterable $paymentLines): self |
|
| 1567 | |||
| 1568 | /** |
||
| 1569 | * @param PaymentLine $paymentLine |
||
| 1570 | * |
||
| 1571 | * @return Payment |
||
| 1572 | */ |
||
| 1573 | 3 | public function addPaymentLine(PaymentLine $paymentLine): self |
|
| 1580 | |||
| 1581 | /** |
||
| 1582 | * A helper method for creating a Money object from a float based on the shared currency |
||
| 1583 | * |
||
| 1584 | * @param int $amount |
||
| 1585 | * @return Money|null |
||
| 1586 | */ |
||
| 1587 | 6 | private function createMoney(int $amount = 0) : ?Money |
|
| 1595 | |||
| 1596 | /** |
||
| 1597 | * A helper method for creating a Money object from a float based on the shared currency |
||
| 1598 | * |
||
| 1599 | * The float can be any format, i.e. 1.50 or 1,50 |
||
| 1600 | * |
||
| 1601 | * @param string $amount |
||
| 1602 | * @return Money|null |
||
| 1603 | */ |
||
| 1604 | 6 | private function createMoneyFromFloat(string $amount = '0.00') : ?Money |
|
| 1609 | } |
||
| 1610 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: