Code Duplication    Length = 36-36 lines in 4 locations

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

@@ 317-352 (lines=36) @@
314
	 * @since  1.0.0
315
	 * @return string
316
	 */
317
	public function generate_text_html( $key, $data ) {
318
		$field_key = $this->get_field_key( $key );
319
		$defaults  = array(
320
			'title'             => '',
321
			'disabled'          => false,
322
			'class'             => '',
323
			'css'               => '',
324
			'placeholder'       => '',
325
			'type'              => 'text',
326
			'desc_tip'          => false,
327
			'description'       => '',
328
			'custom_attributes' => array(),
329
		);
330
331
		$data = wp_parse_args( $data, $defaults );
332
333
		ob_start();
334
		?>
335
		<tr valign="top">
336
			<th scope="row" class="titledesc">
337
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
338
				<?php echo $this->get_tooltip_html( $data ); ?>
339
			</th>
340
			<td class="forminp">
341
				<fieldset>
342
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
343
					<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 ); ?> />
344
					<?php echo $this->get_description_html( $data ); ?>
345
				</fieldset>
346
			</td>
347
		</tr>
348
		<?php
349
350
		return ob_get_clean();
351
	}
352
353
	/**
354
	 * Generate Price Input HTML.
355
	 *
@@ 361-396 (lines=36) @@
358
	 * @since  1.0.0
359
	 * @return string
360
	 */
361
	public function generate_price_html( $key, $data ) {
362
		$field_key = $this->get_field_key( $key );
363
		$defaults  = array(
364
			'title'             => '',
365
			'disabled'          => false,
366
			'class'             => '',
367
			'css'               => '',
368
			'placeholder'       => '',
369
			'type'              => 'text',
370
			'desc_tip'          => false,
371
			'description'       => '',
372
			'custom_attributes' => array(),
373
		);
374
375
		$data = wp_parse_args( $data, $defaults );
376
377
		ob_start();
378
		?>
379
		<tr valign="top">
380
			<th scope="row" class="titledesc">
381
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
382
				<?php echo $this->get_tooltip_html( $data ); ?>
383
			</th>
384
			<td class="forminp">
385
				<fieldset>
386
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
387
					<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 ); ?> />
388
					<?php echo $this->get_description_html( $data ); ?>
389
				</fieldset>
390
			</td>
391
		</tr>
392
		<?php
393
394
		return ob_get_clean();
395
	}
396
397
	/**
398
	 * Generate Decimal Input HTML.
399
	 *
@@ 405-440 (lines=36) @@
402
	 * @since  1.0.0
403
	 * @return string
404
	 */
405
	public function generate_decimal_html( $key, $data ) {
406
		$field_key = $this->get_field_key( $key );
407
		$defaults  = array(
408
			'title'             => '',
409
			'disabled'          => false,
410
			'class'             => '',
411
			'css'               => '',
412
			'placeholder'       => '',
413
			'type'              => 'text',
414
			'desc_tip'          => false,
415
			'description'       => '',
416
			'custom_attributes' => array(),
417
		);
418
419
		$data = wp_parse_args( $data, $defaults );
420
421
		ob_start();
422
		?>
423
		<tr valign="top">
424
			<th scope="row" class="titledesc">
425
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
426
				<?php echo $this->get_tooltip_html( $data ); ?>
427
			</th>
428
			<td class="forminp">
429
				<fieldset>
430
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
431
					<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 ); ?> />
432
					<?php echo $this->get_description_html( $data ); ?>
433
				</fieldset>
434
			</td>
435
		</tr>
436
		<?php
437
438
		return ob_get_clean();
439
	}
440
441
	/**
442
	 * Generate Password Input HTML.
443
	 *
@@ 507-542 (lines=36) @@
504
	 * @since  1.0.0
505
	 * @return string
506
	 */
507
	public function generate_textarea_html( $key, $data ) {
508
		$field_key = $this->get_field_key( $key );
509
		$defaults  = array(
510
			'title'             => '',
511
			'disabled'          => false,
512
			'class'             => '',
513
			'css'               => '',
514
			'placeholder'       => '',
515
			'type'              => 'text',
516
			'desc_tip'          => false,
517
			'description'       => '',
518
			'custom_attributes' => array(),
519
		);
520
521
		$data = wp_parse_args( $data, $defaults );
522
523
		ob_start();
524
		?>
525
		<tr valign="top">
526
			<th scope="row" class="titledesc">
527
				<label for="<?php echo esc_attr( $field_key ); ?>"><?php echo wp_kses_post( $data['title'] ); ?></label>
528
				<?php echo $this->get_tooltip_html( $data ); ?>
529
			</th>
530
			<td class="forminp">
531
				<fieldset>
532
					<legend class="screen-reader-text"><span><?php echo wp_kses_post( $data['title'] ); ?></span></legend>
533
					<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>
534
					<?php echo $this->get_description_html( $data ); ?>
535
				</fieldset>
536
			</td>
537
		</tr>
538
		<?php
539
540
		return ob_get_clean();
541
	}
542
543
	/**
544
	 * Generate Checkbox HTML.
545
	 *