Code Duplication    Length = 7-7 lines in 4 locations

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

@@ 1171-1177 (lines=7) @@
1168
		}
1169
	}
1170
1171
	public function validate_publishable_key_field( $key, $value ) {
1172
		$value = $this->validate_text_field( $key, $value );
1173
		if ( ! empty( $value ) && ! preg_match( '/^pk_live_/', $value ) ) {
1174
			throw new Exception( __( 'The "Live Publishable Key" should start with "pk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1175
		}
1176
		return $value;
1177
	}
1178
1179
	public function validate_secret_key_field( $key, $value ) {
1180
		$value = $this->validate_text_field( $key, $value );
@@ 1179-1185 (lines=7) @@
1176
		return $value;
1177
	}
1178
1179
	public function validate_secret_key_field( $key, $value ) {
1180
		$value = $this->validate_text_field( $key, $value );
1181
		if ( ! empty( $value ) && ! preg_match( '/^[rs]k_live_/', $value ) ) {
1182
			throw new Exception( __( 'The "Live Secret Key" should start with "sk_live" or "rk_live", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1183
		}
1184
		return $value;
1185
	}
1186
1187
	public function validate_test_publishable_key_field( $key, $value ) {
1188
		$value = $this->validate_text_field( $key, $value );
@@ 1187-1193 (lines=7) @@
1184
		return $value;
1185
	}
1186
1187
	public function validate_test_publishable_key_field( $key, $value ) {
1188
		$value = $this->validate_text_field( $key, $value );
1189
		if ( ! empty( $value ) && ! preg_match( '/^pk_test_/', $value ) ) {
1190
			throw new Exception( __( 'The "Test Publishable Key" should start with "pk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1191
		}
1192
		return $value;
1193
	}
1194
1195
	public function validate_test_secret_key_field( $key, $value ) {
1196
		$value = $this->validate_text_field( $key, $value );
@@ 1195-1201 (lines=7) @@
1192
		return $value;
1193
	}
1194
1195
	public function validate_test_secret_key_field( $key, $value ) {
1196
		$value = $this->validate_text_field( $key, $value );
1197
		if ( ! empty( $value ) && ! preg_match( '/^[rs]k_test_/', $value ) ) {
1198
			throw new Exception( __( 'The "Test Secret Key" should start with "sk_test" or "rk_test", enter the correct key.', 'woocommerce-gateway-stripe' ) );
1199
		}
1200
		return $value;
1201
	}
1202
}
1203