Code Duplication    Length = 19-20 lines in 2 locations

includes/EditPage.php 2 locations

@@ 4127-4146 (lines=20) @@
4124
		if ( !$this->isNew ) {
4125
			$checkboxes['minor'] = '';
4126
			$minorLabel = $this->context->msg( 'minoredit' )->parse();
4127
			if ( $wgUser->isAllowed( 'minoredit' ) ) {
4128
				$attribs = [
4129
					'tabindex' => ++$tabindex,
4130
					'accesskey' => $this->context->msg( 'accesskey-minoredit' )->text(),
4131
					'id' => 'wpMinoredit',
4132
				];
4133
				$minorEditHtml =
4134
					Xml::check( 'wpMinoredit', $checked['minor'], $attribs ) .
4135
					"&#160;<label for='wpMinoredit' id='mw-editpage-minoredit'" .
4136
					Xml::expandAttributes( [ 'title' => Linker::titleAttrib( 'minoredit', 'withaccess' ) ] ) .
4137
					">{$minorLabel}</label>";
4138
4139
				if ( $wgUseMediaWikiUIEverywhere ) {
4140
					$checkboxes['minor'] = Html::openElement( 'div', [ 'class' => 'mw-ui-checkbox' ] ) .
4141
						$minorEditHtml .
4142
					Html::closeElement( 'div' );
4143
				} else {
4144
					$checkboxes['minor'] = $minorEditHtml;
4145
				}
4146
			}
4147
		}
4148
4149
		$watchLabel = $this->context->msg( 'watchthis' )->parse();
@@ 4151-4169 (lines=19) @@
4148
4149
		$watchLabel = $this->context->msg( 'watchthis' )->parse();
4150
		$checkboxes['watch'] = '';
4151
		if ( $wgUser->isLoggedIn() ) {
4152
			$attribs = [
4153
				'tabindex' => ++$tabindex,
4154
				'accesskey' => $this->context->msg( 'accesskey-watch' )->text(),
4155
				'id' => 'wpWatchthis',
4156
			];
4157
			$watchThisHtml =
4158
				Xml::check( 'wpWatchthis', $checked['watch'], $attribs ) .
4159
				"&#160;<label for='wpWatchthis' id='mw-editpage-watch'" .
4160
				Xml::expandAttributes( [ 'title' => Linker::titleAttrib( 'watch', 'withaccess' ) ] ) .
4161
				">{$watchLabel}</label>";
4162
			if ( $wgUseMediaWikiUIEverywhere ) {
4163
				$checkboxes['watch'] = Html::openElement( 'div', [ 'class' => 'mw-ui-checkbox' ] ) .
4164
					$watchThisHtml .
4165
					Html::closeElement( 'div' );
4166
			} else {
4167
				$checkboxes['watch'] = $watchThisHtml;
4168
			}
4169
		}
4170
		Hooks::run( 'EditPageBeforeEditChecks', [ &$this, &$checkboxes, &$tabindex ] );
4171
		return $checkboxes;
4172
	}