Code Duplication    Length = 9-9 lines in 2 locations

includes/abstracts/abstract-wc-shipping-method.php 1 location

@@ 494-502 (lines=9) @@
491
492
			$post_data = $this->get_post_data();
493
494
			foreach ( $this->get_instance_form_fields() as $key => $field ) {
495
				if ( 'title' !== $this->get_field_type( $field ) ) {
496
					try {
497
						$this->instance_settings[ $key ] = $this->get_field_value( $key, $field, $post_data );
498
					} catch ( Exception $e ) {
499
						$this->add_error( $e->getMessage() );
500
					}
501
				}
502
			}
503
504
			return update_option( $this->get_instance_option_key(), apply_filters( 'woocommerce_shipping_' . $this->id . '_instance_settings_values', $this->instance_settings, $this ) );
505
		} else {

includes/abstracts/abstract-wc-settings-api.php 1 location

@@ 172-180 (lines=9) @@
169
170
		$post_data = $this->get_post_data();
171
172
		foreach ( $this->get_form_fields() as $key => $field ) {
173
			if ( 'title' !== $this->get_field_type( $field ) ) {
174
				try {
175
					$this->settings[ $key ] = $this->get_field_value( $key, $field, $post_data );
176
				} catch ( Exception $e ) {
177
					$this->add_error( $e->getMessage() );
178
				}
179
			}
180
		}
181
182
		return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) );
183
	}