Code Duplication    Length = 13-16 lines in 3 locations

includes/installer/DatabaseInstaller.php 3 locations

@@ 480-495 (lines=16) @@
477
	 * @param string $helpData
478
	 * @return string
479
	 */
480
	public function getTextBox( $var, $label, $attribs = [], $helpData = "" ) {
481
		$name = $this->getName() . '_' . $var;
482
		$value = $this->getVar( $var );
483
		if ( !isset( $attribs ) ) {
484
			$attribs = [];
485
		}
486
487
		return $this->parent->getTextBox( [
488
			'var' => $var,
489
			'label' => $label,
490
			'attribs' => $attribs,
491
			'controlName' => $name,
492
			'value' => $value,
493
			'help' => $helpData
494
		] );
495
	}
496
497
	/**
498
	 * Get a labelled password box to configure a local variable.
@@ 507-522 (lines=16) @@
504
	 * @param string $helpData
505
	 * @return string
506
	 */
507
	public function getPasswordBox( $var, $label, $attribs = [], $helpData = "" ) {
508
		$name = $this->getName() . '_' . $var;
509
		$value = $this->getVar( $var );
510
		if ( !isset( $attribs ) ) {
511
			$attribs = [];
512
		}
513
514
		return $this->parent->getPasswordBox( [
515
			'var' => $var,
516
			'label' => $label,
517
			'attribs' => $attribs,
518
			'controlName' => $name,
519
			'value' => $value,
520
			'help' => $helpData
521
		] );
522
	}
523
524
	/**
525
	 * Get a labelled checkbox to configure a local boolean variable.
@@ 533-545 (lines=13) @@
530
	 * @param string $helpData Optional.
531
	 * @return string
532
	 */
533
	public function getCheckBox( $var, $label, $attribs = [], $helpData = "" ) {
534
		$name = $this->getName() . '_' . $var;
535
		$value = $this->getVar( $var );
536
537
		return $this->parent->getCheckBox( [
538
			'var' => $var,
539
			'label' => $label,
540
			'attribs' => $attribs,
541
			'controlName' => $name,
542
			'value' => $value,
543
			'help' => $helpData
544
		] );
545
	}
546
547
	/**
548
	 * Get a set of labelled radio buttons.