Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 446-454 (lines=9) @@
443
		if ( $this->instance_id ) {
444
			$this->init_instance_settings();
445
446
			foreach ( $this->get_instance_form_fields() as $key => $field ) {
447
				if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) {
448
					try {
449
						$this->instance_settings[ $key ] = $this->get_field_value( $key, $field );
450
					} catch ( Exception $e ) {
451
						$this->add_error( $e->getMessage() );
452
					}
453
				}
454
			}
455
456
			return update_option( $this->get_instance_option_key(), apply_filters( 'woocommerce_shipping_' . $this->id . '_instance_settings_values', $this->instance_settings, $this ) );
457
		} else {

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

@@ 127-135 (lines=9) @@
124
	public function process_admin_options() {
125
		$this->init_settings();
126
127
		foreach ( $this->get_form_fields() as $key => $field ) {
128
			if ( ! in_array( $this->get_field_type( $field ), array( 'title' ) ) ) {
129
				try {
130
					$this->settings[ $key ] = $this->get_field_value( $key, $field );
131
				} catch ( Exception $e ) {
132
					$this->add_error( $e->getMessage() );
133
				}
134
			}
135
		}
136
137
		return update_option( $this->get_option_key(), apply_filters( 'woocommerce_settings_api_sanitized_fields_' . $this->id, $this->settings ) );
138
	}