Code Duplication    Length = 14-15 lines in 3 locations

includes/Title.php 3 locations

@@ 4700-4714 (lines=15) @@
4697
		// Optional notice for the entire namespace
4698
		$editnotice_ns = 'editnotice-' . $this->getNamespace();
4699
		$msg = wfMessage( $editnotice_ns );
4700
		if ( $msg->exists() ) {
4701
			$html = $msg->parseAsBlock();
4702
			// Edit notices may have complex logic, but output nothing (T91715)
4703
			if ( trim( $html ) !== '' ) {
4704
				$notices[$editnotice_ns] = Html::rawElement(
4705
					'div',
4706
					[ 'class' => [
4707
						'mw-editnotice',
4708
						'mw-editnotice-namespace',
4709
						Sanitizer::escapeClass( "mw-$editnotice_ns" )
4710
					] ],
4711
					$html
4712
				);
4713
			}
4714
		}
4715
4716
		if ( MWNamespace::hasSubpages( $this->getNamespace() ) ) {
4717
			// Optional notice for page itself and any parent page
@@ 4723-4736 (lines=14) @@
4720
			while ( count( $parts ) > 0 ) {
4721
				$editnotice_base .= '-' . array_shift( $parts );
4722
				$msg = wfMessage( $editnotice_base );
4723
				if ( $msg->exists() ) {
4724
					$html = $msg->parseAsBlock();
4725
					if ( trim( $html ) !== '' ) {
4726
						$notices[$editnotice_base] = Html::rawElement(
4727
							'div',
4728
							[ 'class' => [
4729
								'mw-editnotice',
4730
								'mw-editnotice-base',
4731
								Sanitizer::escapeClass( "mw-$editnotice_base" )
4732
							] ],
4733
							$html
4734
						);
4735
					}
4736
				}
4737
			}
4738
		} else {
4739
			// Even if there are no subpages in namespace, we still don't want "/" in MediaWiki message keys
@@ 4742-4755 (lines=14) @@
4739
			// Even if there are no subpages in namespace, we still don't want "/" in MediaWiki message keys
4740
			$editnoticeText = $editnotice_ns . '-' . strtr( $this->getDBkey(), '/', '-' );
4741
			$msg = wfMessage( $editnoticeText );
4742
			if ( $msg->exists() ) {
4743
				$html = $msg->parseAsBlock();
4744
				if ( trim( $html ) !== '' ) {
4745
					$notices[$editnoticeText] = Html::rawElement(
4746
						'div',
4747
						[ 'class' => [
4748
							'mw-editnotice',
4749
							'mw-editnotice-page',
4750
							Sanitizer::escapeClass( "mw-$editnoticeText" )
4751
						] ],
4752
						$html
4753
					);
4754
				}
4755
			}
4756
		}
4757
4758
		Hooks::run( 'TitleGetEditNotices', [ $this, $oldid, &$notices ] );