Code Duplication    Length = 19-20 lines in 2 locations

includes/EditPage.php 2 locations

@@ 4021-4040 (lines=20) @@
4018
		if ( !$this->isNew ) {
4019
			$checkboxes['minor'] = '';
4020
			$minorLabel = $this->context->msg( 'minoredit' )->parse();
4021
			if ( $wgUser->isAllowed( 'minoredit' ) ) {
4022
				$attribs = [
4023
					'tabindex' => ++$tabindex,
4024
					'accesskey' => $this->context->msg( 'accesskey-minoredit' )->text(),
4025
					'id' => 'wpMinoredit',
4026
				];
4027
				$minorEditHtml =
4028
					Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
4029
					"&#160;<label for='wpMinoredit' id='mw-editpage-minoredit'" .
4030
					Xml::expandAttributes( [ 'title' => Linker::titleAttrib( 'minoredit', 'withaccess' ) ] ) .
4031
					">{$minorLabel}</label>";
4032
4033
				if ( $wgUseMediaWikiUIEverywhere ) {
4034
					$checkboxes['minor'] = Html::openElement( 'div', [ 'class' => 'mw-ui-checkbox' ] ) .
4035
						$minorEditHtml .
4036
					Html::closeElement( 'div' );
4037
				} else {
4038
					$checkboxes['minor'] = $minorEditHtml;
4039
				}
4040
			}
4041
		}
4042
4043
		$watchLabel = $this->context->msg( 'watchthis' )->parse();
@@ 4045-4063 (lines=19) @@
4042
4043
		$watchLabel = $this->context->msg( 'watchthis' )->parse();
4044
		$checkboxes['watch'] = '';
4045
		if ( $wgUser->isLoggedIn() ) {
4046
			$attribs = [
4047
				'tabindex' => ++$tabindex,
4048
				'accesskey' => $this->context->msg( 'accesskey-watch' )->text(),
4049
				'id' => 'wpWatchthis',
4050
			];
4051
			$watchThisHtml =
4052
				Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
4053
				"&#160;<label for='wpWatchthis' id='mw-editpage-watch'" .
4054
				Xml::expandAttributes( [ 'title' => Linker::titleAttrib( 'watch', 'withaccess' ) ] ) .
4055
				">{$watchLabel}</label>";
4056
			if ( $wgUseMediaWikiUIEverywhere ) {
4057
				$checkboxes['watch'] = Html::openElement( 'div', [ 'class' => 'mw-ui-checkbox' ] ) .
4058
					$watchThisHtml .
4059
					Html::closeElement( 'div' );
4060
			} else {
4061
				$checkboxes['watch'] = $watchThisHtml;
4062
			}
4063
		}
4064
		Hooks::run( 'EditPageBeforeEditChecks', [ &$this, &$checkboxes, &$tabindex ] );
4065
		return $checkboxes;
4066
	}