@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | if ($this->isTag($word)) { |
121 | 121 | $word = $this->stripTagAttributes($word); |
122 | 122 | } |
123 | - if (isset($this->wordIndices[ $word ])) { |
|
124 | - $this->wordIndices[ $word ][] = $i; |
|
123 | + if (isset($this->wordIndices[$word])) { |
|
124 | + $this->wordIndices[$word][] = $i; |
|
125 | 125 | } else { |
126 | - $this->wordIndices[ $word ] = array($i); |
|
126 | + $this->wordIndices[$word] = array($i); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | } else { |
540 | 540 | $firstOrDefault = false; |
541 | 541 | foreach ($this->config->getSpecialCaseOpeningTags() as $x) { |
542 | - if (preg_match($x, $words[ 0 ])) { |
|
542 | + if (preg_match($x, $words[0])) { |
|
543 | 543 | $firstOrDefault = $x; |
544 | 544 | break; |
545 | 545 | } |
@@ -547,13 +547,13 @@ discard block |
||
547 | 547 | if ($firstOrDefault) { |
548 | 548 | $specialCaseTagInjection = '<ins class="mod">'; |
549 | 549 | if ($tag == 'del') { |
550 | - unset($words[ 0 ]); |
|
550 | + unset($words[0]); |
|
551 | 551 | } |
552 | - } elseif (array_search($words[ 0 ], $this->config->getSpecialCaseClosingTags()) !== false) { |
|
552 | + } elseif (array_search($words[0], $this->config->getSpecialCaseClosingTags()) !== false) { |
|
553 | 553 | $specialCaseTagInjection = '</ins>'; |
554 | 554 | $specialCaseTagInjectionIsBefore = true; |
555 | 555 | if ($tag == 'del') { |
556 | - unset($words[ 0 ]); |
|
556 | + unset($words[0]); |
|
557 | 557 | } |
558 | 558 | } |
559 | 559 | } |
@@ -564,12 +564,12 @@ discard block |
||
564 | 564 | $this->content .= $specialCaseTagInjection.implode('', $this->extractConsecutiveWords($words, 'tag')); |
565 | 565 | } else { |
566 | 566 | $workTag = $this->extractConsecutiveWords($words, 'tag'); |
567 | - if (isset($workTag[ 0 ]) && $this->isOpeningTag($workTag[ 0 ]) && !$this->isClosingTag($workTag[ 0 ])) { |
|
568 | - if (strpos($workTag[ 0 ], 'class=')) { |
|
569 | - $workTag[ 0 ] = str_replace('class="', 'class="diffmod ', $workTag[ 0 ]); |
|
570 | - $workTag[ 0 ] = str_replace("class='", 'class="diffmod ', $workTag[ 0 ]); |
|
567 | + if (isset($workTag[0]) && $this->isOpeningTag($workTag[0]) && !$this->isClosingTag($workTag[0])) { |
|
568 | + if (strpos($workTag[0], 'class=')) { |
|
569 | + $workTag[0] = str_replace('class="', 'class="diffmod ', $workTag[0]); |
|
570 | + $workTag[0] = str_replace("class='", 'class="diffmod ', $workTag[0]); |
|
571 | 571 | } else { |
572 | - $workTag[ 0 ] = str_replace('>', ' class="diffmod">', $workTag[ 0 ]); |
|
572 | + $workTag[0] = str_replace('>', ' class="diffmod">', $workTag[0]); |
|
573 | 573 | } |
574 | 574 | } |
575 | 575 | |
@@ -754,7 +754,7 @@ discard block |
||
754 | 754 | { |
755 | 755 | $word = explode(' ', trim($word, '<>')); |
756 | 756 | |
757 | - return '<'.$word[ 0 ].'>'; |
|
757 | + return '<'.$word[0].'>'; |
|
758 | 758 | } |
759 | 759 | |
760 | 760 | /** |
@@ -773,23 +773,23 @@ discard block |
||
773 | 773 | $matchLengthAt = array(); |
774 | 774 | for ($indexInOld = $startInOld; $indexInOld < $endInOld; ++$indexInOld) { |
775 | 775 | $newMatchLengthAt = array(); |
776 | - $index = $this->oldWords[ $indexInOld ]; |
|
776 | + $index = $this->oldWords[$indexInOld]; |
|
777 | 777 | if ($this->isTag($index)) { |
778 | 778 | $index = $this->stripTagAttributes($index); |
779 | 779 | } |
780 | - if (!isset($this->wordIndices[ $index ])) { |
|
780 | + if (!isset($this->wordIndices[$index])) { |
|
781 | 781 | $matchLengthAt = $newMatchLengthAt; |
782 | 782 | continue; |
783 | 783 | } |
784 | - foreach ($this->wordIndices[ $index ] as $indexInNew) { |
|
784 | + foreach ($this->wordIndices[$index] as $indexInNew) { |
|
785 | 785 | if ($indexInNew < $startInNew) { |
786 | 786 | continue; |
787 | 787 | } |
788 | 788 | if ($indexInNew >= $endInNew) { |
789 | 789 | break; |
790 | 790 | } |
791 | - $newMatchLength = (isset($matchLengthAt[ $indexInNew - 1 ]) ? $matchLengthAt[ $indexInNew - 1 ] : 0) + 1; |
|
792 | - $newMatchLengthAt[ $indexInNew ] = $newMatchLength; |
|
791 | + $newMatchLength = (isset($matchLengthAt[$indexInNew - 1]) ? $matchLengthAt[$indexInNew - 1] : 0) + 1; |
|
792 | + $newMatchLengthAt[$indexInNew] = $newMatchLength; |
|
793 | 793 | if ($newMatchLength > $bestMatchSize || |
794 | 794 | ( |
795 | 795 | $this->isGroupDiffs() && |
@@ -319,7 +319,7 @@ |
||
319 | 319 | { |
320 | 320 | $expStr = explode($start, $str, 2); |
321 | 321 | if (count($expStr) > 1) { |
322 | - $expStr = explode($end, $expStr[ 1 ]); |
|
322 | + $expStr = explode($end, $expStr[1]); |
|
323 | 323 | if (count($expStr) > 1) { |
324 | 324 | array_pop($expStr); |
325 | 325 |
@@ -371,7 +371,7 @@ |
||
371 | 371 | $columns = $this->getArrayColumn($bestMatchPercentages, $key); |
372 | 372 | $thisBestMatches = array_filter( |
373 | 373 | $columns, |
374 | - function ($v) use ($percent) { |
|
374 | + function($v) use ($percent) { |
|
375 | 375 | return $v > $percent; |
376 | 376 | } |
377 | 377 | ); |