Code Duplication    Length = 13-13 lines in 2 locations

includes/parser/Preprocessor_DOM.php 1 location

@@ 558-570 (lines=13) @@
555
				$count = $piece->count;
556
				$equalsLength = strspn( $revText, '=', $lengthText - $searchStart );
557
				if ( $equalsLength > 0 ) {
558
					if ( $searchStart - $equalsLength == $piece->startPos ) {
559
						// This is just a single string of equals signs on its own line
560
						// Replicate the doHeadings behavior /={count}(.+)={count}/
561
						// First find out how many equals signs there really are (don't stop at 6)
562
						$count = $equalsLength;
563
						if ( $count < 3 ) {
564
							$count = 0;
565
						} else {
566
							$count = min( 6, intval( ( $count - 1 ) / 2 ) );
567
						}
568
					} else {
569
						$count = min( $equalsLength, $count );
570
					}
571
					if ( $count > 0 ) {
572
						// Normal match, output <h>
573
						$element = "<h level=\"$count\" i=\"$headingIndex\">$accum</h>";

includes/parser/Preprocessor_Hash.php 1 location

@@ 494-506 (lines=13) @@
491
				$count = $piece->count;
492
				$equalsLength = strspn( $revText, '=', $lengthText - $searchStart );
493
				if ( $equalsLength > 0 ) {
494
					if ( $searchStart - $equalsLength == $piece->startPos ) {
495
						// This is just a single string of equals signs on its own line
496
						// Replicate the doHeadings behavior /={count}(.+)={count}/
497
						// First find out how many equals signs there really are (don't stop at 6)
498
						$count = $equalsLength;
499
						if ( $count < 3 ) {
500
							$count = 0;
501
						} else {
502
							$count = min( 6, intval( ( $count - 1 ) / 2 ) );
503
						}
504
					} else {
505
						$count = min( $equalsLength, $count );
506
					}
507
					if ( $count > 0 ) {
508
						// Normal match, output <h>
509
						$element = [ [ 'possible-h',