Code Duplication    Length = 7-7 lines in 4 locations

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

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