Code Duplication    Length = 5-5 lines in 3 locations

sdk/ECPay.Payment.Integration.php 3 locations

@@ 1038-1042 (lines=5) @@
1035
            switch ($arExtend['CarrierType']) {
1036
                // 載具類別為無載具(None)或會員載具(Member)時,請設定空字串
1037
                case ECPay_CarrierType::None:
1038
                case ECPay_CarrierType::Member:
1039
                    if (strlen($arExtend['CarrierNum']) > 0) {
1040
                        array_push($arErrors, 'Please remove CarrierNum.');
1041
                    }
1042
                break;
1043
                // 載具類別為買受人自然人憑證(Citizen)時,請設定自然人憑證號碼,前2碼為大小寫英文,後14碼為數字
1044
                case ECPay_CarrierType::Citizen:
1045
                    if (! preg_match('/^[a-zA-Z]{2}\d{14}$/', $arExtend['CarrierNum'])) {
@@ 1044-1048 (lines=5) @@
1041
                    }
1042
                break;
1043
                // 載具類別為買受人自然人憑證(Citizen)時,請設定自然人憑證號碼,前2碼為大小寫英文,後14碼為數字
1044
                case ECPay_CarrierType::Citizen:
1045
                    if (! preg_match('/^[a-zA-Z]{2}\d{14}$/', $arExtend['CarrierNum'])) {
1046
                        array_push($arErrors, 'Invalid CarrierNum.');
1047
                    }
1048
                break;
1049
                // 載具類別為買受人手機條碼(Cellphone)時,請設定手機條碼,第1碼為「/」,後7碼為大小寫英文、數字、「+」、「-」或「.」
1050
                case ECPay_CarrierType::Cellphone:
1051
                    if (! preg_match('/^\/{1}[0-9a-zA-Z+-.]{7}$/', $arExtend['CarrierNum'])) {
@@ 1050-1054 (lines=5) @@
1047
                    }
1048
                break;
1049
                // 載具類別為買受人手機條碼(Cellphone)時,請設定手機條碼,第1碼為「/」,後7碼為大小寫英文、數字、「+」、「-」或「.」
1050
                case ECPay_CarrierType::Cellphone:
1051
                    if (! preg_match('/^\/{1}[0-9a-zA-Z+-.]{7}$/', $arExtend['CarrierNum'])) {
1052
                        array_push($arErrors, 'Invalid CarrierNum.');
1053
                    }
1054
                break;
1055
1056
                default:
1057
                    array_push($arErrors, 'Please remove CarrierNum.');