Code Duplication    Length = 36-36 lines in 4 locations

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

@@ 356-391 (lines=36) @@
353
	 * @since  1.0.0
354
	 * @return string
355
	 */
356
	public function generate_text_html( $key, $data ) {
357
		$field_key = $this->get_field_key( $key );
358
		$defaults  = array(
359
			'title'             => '',
360
			'disabled'          => false,
361
			'class'             => '',
362
			'css'               => '',
363
			'placeholder'       => '',
364
			'type'              => 'text',
365
			'desc_tip'          => false,
366
			'description'       => '',
367
			'custom_attributes' => array(),
368
		);
369
370
		$data = wp_parse_args( $data, $defaults );
371
372
		ob_start();
373
		?>
374
		<tr valign="top">
375
			<th scope="row" class="titledesc">
376
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
377
				<?php echo $this->get_tooltip_html( $data ); ?>
378
			</th>
379
			<td class="forminp">
380
				<fieldset>
381
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
382
					<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 ); ?> />
383
					<?php echo $this->get_description_html( $data ); ?>
384
				</fieldset>
385
			</td>
386
		</tr>
387
		<?php
388
389
		return ob_get_clean();
390
	}
391
392
	/**
393
	 * Generate Price Input HTML.
394
	 *
@@ 400-435 (lines=36) @@
397
	 * @since  1.0.0
398
	 * @return string
399
	 */
400
	public function generate_price_html( $key, $data ) {
401
		$field_key = $this->get_field_key( $key );
402
		$defaults  = array(
403
			'title'             => '',
404
			'disabled'          => false,
405
			'class'             => '',
406
			'css'               => '',
407
			'placeholder'       => '',
408
			'type'              => 'text',
409
			'desc_tip'          => false,
410
			'description'       => '',
411
			'custom_attributes' => array(),
412
		);
413
414
		$data = wp_parse_args( $data, $defaults );
415
416
		ob_start();
417
		?>
418
		<tr valign="top">
419
			<th scope="row" class="titledesc">
420
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
421
				<?php echo $this->get_tooltip_html( $data ); ?>
422
			</th>
423
			<td class="forminp">
424
				<fieldset>
425
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
426
					<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 ); ?> />
427
					<?php echo $this->get_description_html( $data ); ?>
428
				</fieldset>
429
			</td>
430
		</tr>
431
		<?php
432
433
		return ob_get_clean();
434
	}
435
436
	/**
437
	 * Generate Decimal Input HTML.
438
	 *
@@ 444-479 (lines=36) @@
441
	 * @since  1.0.0
442
	 * @return string
443
	 */
444
	public function generate_decimal_html( $key, $data ) {
445
		$field_key = $this->get_field_key( $key );
446
		$defaults  = array(
447
			'title'             => '',
448
			'disabled'          => false,
449
			'class'             => '',
450
			'css'               => '',
451
			'placeholder'       => '',
452
			'type'              => 'text',
453
			'desc_tip'          => false,
454
			'description'       => '',
455
			'custom_attributes' => array(),
456
		);
457
458
		$data = wp_parse_args( $data, $defaults );
459
460
		ob_start();
461
		?>
462
		<tr valign="top">
463
			<th scope="row" class="titledesc">
464
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
465
				<?php echo $this->get_tooltip_html( $data ); ?>
466
			</th>
467
			<td class="forminp">
468
				<fieldset>
469
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
470
					<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 ); ?> />
471
					<?php echo $this->get_description_html( $data ); ?>
472
				</fieldset>
473
			</td>
474
		</tr>
475
		<?php
476
477
		return ob_get_clean();
478
	}
479
480
	/**
481
	 * Generate Password Input HTML.
482
	 *
@@ 546-581 (lines=36) @@
543
	 * @since  1.0.0
544
	 * @return string
545
	 */
546
	public function generate_textarea_html( $key, $data ) {
547
		$field_key = $this->get_field_key( $key );
548
		$defaults  = array(
549
			'title'             => '',
550
			'disabled'          => false,
551
			'class'             => '',
552
			'css'               => '',
553
			'placeholder'       => '',
554
			'type'              => 'text',
555
			'desc_tip'          => false,
556
			'description'       => '',
557
			'custom_attributes' => array(),
558
		);
559
560
		$data = wp_parse_args( $data, $defaults );
561
562
		ob_start();
563
		?>
564
		<tr valign="top">
565
			<th scope="row" class="titledesc">
566
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
567
				<?php echo $this->get_tooltip_html( $data ); ?>
568
			</th>
569
			<td class="forminp">
570
				<fieldset>
571
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
572
					<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>
573
					<?php echo $this->get_description_html( $data ); ?>
574
				</fieldset>
575
			</td>
576
		</tr>
577
		<?php
578
579
		return ob_get_clean();
580
	}
581
582
	/**
583
	 * Generate Checkbox HTML.
584
	 *