Code Duplication    Length = 7-7 lines in 4 locations

includes/class-wc-gateway-stripe.php 4 locations

@@ 1197-1203 (lines=7) @@
1194
		}
1195
	}
1196
1197
	public function validate_publishable_key_field( $key, $value ) {
1198
		$value = $this->validate_text_field( $key, $value );
1199
		if ( ! empty( $value ) && ! preg_match( '/^pk_live_/', $value ) ) {
1200
			throw new Exception( __( 'The "Live Publishable Key" should start with "pk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1201
		}
1202
		return $value;
1203
	}
1204
1205
	public function validate_secret_key_field( $key, $value ) {
1206
		$value = $this->validate_text_field( $key, $value );
@@ 1205-1211 (lines=7) @@
1202
		return $value;
1203
	}
1204
1205
	public function validate_secret_key_field( $key, $value ) {
1206
		$value = $this->validate_text_field( $key, $value );
1207
		if ( ! empty( $value ) && ! preg_match( '/^[rs]k_live_/', $value ) ) {
1208
			throw new Exception( __( 'The "Live Secret Key" should start with "sk_live" or "rk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1209
		}
1210
		return $value;
1211
	}
1212
1213
	public function validate_test_publishable_key_field( $key, $value ) {
1214
		$value = $this->validate_text_field( $key, $value );
@@ 1213-1219 (lines=7) @@
1210
		return $value;
1211
	}
1212
1213
	public function validate_test_publishable_key_field( $key, $value ) {
1214
		$value = $this->validate_text_field( $key, $value );
1215
		if ( ! empty( $value ) && ! preg_match( '/^pk_test_/', $value ) ) {
1216
			throw new Exception( __( 'The "Test Publishable Key" should start with "pk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1217
		}
1218
		return $value;
1219
	}
1220
1221
	public function validate_test_secret_key_field( $key, $value ) {
1222
		$value = $this->validate_text_field( $key, $value );
@@ 1221-1227 (lines=7) @@
1218
		return $value;
1219
	}
1220
1221
	public function validate_test_secret_key_field( $key, $value ) {
1222
		$value = $this->validate_text_field( $key, $value );
1223
		if ( ! empty( $value ) && ! preg_match( '/^[rs]k_test_/', $value ) ) {
1224
			throw new Exception( __( 'The "Test Secret Key" should start with "sk_test" or "rk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1225
		}
1226
		return $value;
1227
	}
1228
}
1229