Code Duplication    Length = 36-36 lines in 4 locations

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

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