Code Duplication    Length = 7-7 lines in 4 locations

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

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