Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 426-434 (lines=9) @@
423
	 * Initialise Settings for instances.
424
	 * @since 2.6.0
425
	 */
426
	public function init_instance_settings() {
427
		$this->instance_settings = get_option( $this->get_instance_option_key(), null );
428
429
		// If there are no settings defined, use defaults.
430
		if ( ! is_array( $this->instance_settings ) ) {
431
			$form_fields             = $this->get_instance_form_fields();
432
			$this->instance_settings = array_merge( array_fill_keys( array_keys( $form_fields ), '' ), wp_list_pluck( $form_fields, 'default' ) );
433
		}
434
	}
435
436
	/**
437
	 * Processes and saves options.

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

@@ 171-179 (lines=9) @@
168
	 * @since 1.0.0
169
	 * @uses get_option(), add_option()
170
	 */
171
	public function init_settings() {
172
		$this->settings = get_option( $this->get_option_key(), null );
173
174
		// If there are no settings defined, use defaults.
175
		if ( ! is_array( $this->settings ) ) {
176
			$form_fields    = $this->get_form_fields();
177
			$this->settings = array_merge( array_fill_keys( array_keys( $form_fields ), '' ), wp_list_pluck( $form_fields, 'default' ) );
178
		}
179
	}
180
181
	/**
182
	 * get_option function.