Code Duplication    Length = 36-36 lines in 4 locations

includes/abstracts/abstract-wc-settings-api.php 4 locations

@@ 372-407 (lines=36) @@
369
	 * @since  1.0.0
370
	 * @return string
371
	 */
372
	public function generate_text_html( $key, $data ) {
373
		$field_key = $this->get_field_key( $key );
374
		$defaults  = array(
375
			'title'             => '',
376
			'disabled'          => false,
377
			'class'             => '',
378
			'css'               => '',
379
			'placeholder'       => '',
380
			'type'              => 'text',
381
			'desc_tip'          => false,
382
			'description'       => '',
383
			'custom_attributes' => array(),
384
		);
385
386
		$data = wp_parse_args( $data, $defaults );
387
388
		ob_start();
389
		?>
390
		<tr valign="top">
391
			<th scope="row" class="titledesc">
392
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
393
				<?php echo $this->get_tooltip_html( $data ); ?>
394
			</th>
395
			<td class="forminp">
396
				<fieldset>
397
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
398
					<input class="input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( $this->get_option( $key ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
399
					<?php echo $this->get_description_html( $data ); ?>
400
				</fieldset>
401
			</td>
402
		</tr>
403
		<?php
404
405
		return ob_get_clean();
406
	}
407
408
	/**
409
	 * Generate Price Input HTML.
410
	 *
@@ 416-451 (lines=36) @@
413
	 * @since  1.0.0
414
	 * @return string
415
	 */
416
	public function generate_price_html( $key, $data ) {
417
		$field_key = $this->get_field_key( $key );
418
		$defaults  = array(
419
			'title'             => '',
420
			'disabled'          => false,
421
			'class'             => '',
422
			'css'               => '',
423
			'placeholder'       => '',
424
			'type'              => 'text',
425
			'desc_tip'          => false,
426
			'description'       => '',
427
			'custom_attributes' => array(),
428
		);
429
430
		$data = wp_parse_args( $data, $defaults );
431
432
		ob_start();
433
		?>
434
		<tr valign="top">
435
			<th scope="row" class="titledesc">
436
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
437
				<?php echo $this->get_tooltip_html( $data ); ?>
438
			</th>
439
			<td class="forminp">
440
				<fieldset>
441
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
442
					<input class="wc_input_price input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( wc_format_localized_price( $this->get_option( $key ) ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
443
					<?php echo $this->get_description_html( $data ); ?>
444
				</fieldset>
445
			</td>
446
		</tr>
447
		<?php
448
449
		return ob_get_clean();
450
	}
451
452
	/**
453
	 * Generate Decimal Input HTML.
454
	 *
@@ 460-495 (lines=36) @@
457
	 * @since  1.0.0
458
	 * @return string
459
	 */
460
	public function generate_decimal_html( $key, $data ) {
461
		$field_key = $this->get_field_key( $key );
462
		$defaults  = array(
463
			'title'             => '',
464
			'disabled'          => false,
465
			'class'             => '',
466
			'css'               => '',
467
			'placeholder'       => '',
468
			'type'              => 'text',
469
			'desc_tip'          => false,
470
			'description'       => '',
471
			'custom_attributes' => array(),
472
		);
473
474
		$data = wp_parse_args( $data, $defaults );
475
476
		ob_start();
477
		?>
478
		<tr valign="top">
479
			<th scope="row" class="titledesc">
480
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
481
				<?php echo $this->get_tooltip_html( $data ); ?>
482
			</th>
483
			<td class="forminp">
484
				<fieldset>
485
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
486
					<input class="wc_input_decimal input-text regular-input <?php echo esc_attr( $data['class'] ); ?>" type="text" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" value="<?php echo esc_attr( wc_format_localized_decimal( $this->get_option( $key ) ) ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?> />
487
					<?php echo $this->get_description_html( $data ); ?>
488
				</fieldset>
489
			</td>
490
		</tr>
491
		<?php
492
493
		return ob_get_clean();
494
	}
495
496
	/**
497
	 * Generate Password Input HTML.
498
	 *
@@ 562-597 (lines=36) @@
559
	 * @since  1.0.0
560
	 * @return string
561
	 */
562
	public function generate_textarea_html( $key, $data ) {
563
		$field_key = $this->get_field_key( $key );
564
		$defaults  = array(
565
			'title'             => '',
566
			'disabled'          => false,
567
			'class'             => '',
568
			'css'               => '',
569
			'placeholder'       => '',
570
			'type'              => 'text',
571
			'desc_tip'          => false,
572
			'description'       => '',
573
			'custom_attributes' => array(),
574
		);
575
576
		$data = wp_parse_args( $data, $defaults );
577
578
		ob_start();
579
		?>
580
		<tr valign="top">
581
			<th scope="row" class="titledesc">
582
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
583
				<?php echo $this->get_tooltip_html( $data ); ?>
584
			</th>
585
			<td class="forminp">
586
				<fieldset>
587
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
588
					<textarea rows="3" cols="20" class="input-text wide-input <?php echo esc_attr( $data['class'] ); ?>" type="<?php echo esc_attr( $data['type'] ); ?>" name="<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>" style="<?php echo esc_attr( $data['css'] ); ?>" placeholder="<?php echo esc_attr( $data['placeholder'] ); ?>" <?php disabled( $data['disabled'], true ); ?> <?php echo $this->get_custom_attribute_html( $data ); ?>><?php echo esc_textarea( $this->get_option( $key ) ); ?></textarea>
589
					<?php echo $this->get_description_html( $data ); ?>
590
				</fieldset>
591
			</td>
592
		</tr>
593
		<?php
594
595
		return ob_get_clean();
596
	}
597
598
	/**
599
	 * Generate Checkbox HTML.
600
	 *