Code Duplication    Length = 14-15 lines in 2 locations

includes/class-wc-coupon.php 2 locations

@@ 1267-1280 (lines=14) @@
1264
	 * @param integer $msg_code
1265
	 * @return string| Message/error string
1266
	 */
1267
	public function get_coupon_message( $msg_code ) {
1268
		switch ( $msg_code ) {
1269
			case self::WC_COUPON_SUCCESS :
1270
				$msg = __( 'Coupon code applied successfully.', 'woocommerce' );
1271
			break;
1272
			case self::WC_COUPON_REMOVED :
1273
				$msg = __( 'Coupon code removed successfully.', 'woocommerce' );
1274
			break;
1275
			default:
1276
				$msg = '';
1277
			break;
1278
		}
1279
		return apply_filters( 'woocommerce_coupon_message', $msg, $msg_code, $this );
1280
	}
1281
1282
	/**
1283
	 * Map one of the WC_Coupon error codes to a message string.
@@ 1373-1387 (lines=15) @@
1370
	 * @param int $err_code Error code
1371
	 * @return string| Error string
1372
	 */
1373
	public static function get_generic_coupon_error( $err_code ) {
1374
		switch ( $err_code ) {
1375
			case self::E_WC_COUPON_NOT_EXIST:
1376
				$err = __( 'Coupon does not exist!', 'woocommerce' );
1377
			break;
1378
			case self::E_WC_COUPON_PLEASE_ENTER:
1379
				$err = __( 'Please enter a coupon code.', 'woocommerce' );
1380
			break;
1381
			default:
1382
				$err = '';
1383
			break;
1384
		}
1385
		// When using this static method, there is no $this to pass to filter
1386
		return apply_filters( 'woocommerce_coupon_error', $err, $err_code, null );
1387
	}
1388
}
1389