Code Duplication    Length = 4-4 lines in 4 locations

includes/Preferences.php 4 locations

@@ 604-607 (lines=4) @@
601
			$linkTools = [];
602
			$userName = $user->getName();
603
604
			if ( $allowUserCss ) {
605
				$cssPage = Title::makeTitleSafe( NS_USER, $userName . '/common.css' );
606
				$linkTools[] = Linker::link( $cssPage, $context->msg( 'prefs-custom-css' )->escaped() );
607
			}
608
609
			if ( $allowUserJs ) {
610
				$jsPage = Title::makeTitleSafe( NS_USER, $userName . '/common.js' );
@@ 609-612 (lines=4) @@
606
				$linkTools[] = Linker::link( $cssPage, $context->msg( 'prefs-custom-css' )->escaped() );
607
			}
608
609
			if ( $allowUserJs ) {
610
				$jsPage = Title::makeTitleSafe( NS_USER, $userName . '/common.js' );
611
				$linkTools[] = Linker::link( $jsPage, $context->msg( 'prefs-custom-js' )->escaped() );
612
			}
613
614
			$defaultPreferences['commoncssjs'] = [
615
				'type' => 'info',
@@ 1146-1149 (lines=4) @@
1143
			$linkTools[] = "<a target='_blank' href=\"$mplink\">$previewtext</a>";
1144
1145
			# Create links to user CSS/JS pages
1146
			if ( $allowUserCss ) {
1147
				$cssPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.css' );
1148
				$linkTools[] = Linker::link( $cssPage, $context->msg( 'prefs-custom-css' )->escaped() );
1149
			}
1150
1151
			if ( $allowUserJs ) {
1152
				$jsPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.js' );
@@ 1151-1154 (lines=4) @@
1148
				$linkTools[] = Linker::link( $cssPage, $context->msg( 'prefs-custom-css' )->escaped() );
1149
			}
1150
1151
			if ( $allowUserJs ) {
1152
				$jsPage = Title::makeTitleSafe( NS_USER, $user->getName() . '/' . $skinkey . '.js' );
1153
				$linkTools[] = Linker::link( $jsPage, $context->msg( 'prefs-custom-js' )->escaped() );
1154
			}
1155
1156
			$display = $sn . ' ' . $context->msg( 'parentheses' )
1157
				->rawParams( $context->getLanguage()->pipeList( $linkTools ) )