@@ -4,12 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Caxy\HtmlDiff\Strategy\ListItemMatchStrategy; |
| 6 | 6 | use DOMDocument; |
| 7 | -use DOMDocumentFragment; |
|
| 8 | 7 | use DOMElement; |
| 9 | 8 | use DOMNode; |
| 10 | -use DOMNodeList; |
|
| 11 | 9 | use DOMText; |
| 12 | -use KubAT\PhpSimple\HtmlDomParser; |
|
| 13 | 10 | use LogicException; |
| 14 | 11 | |
| 15 | 12 | class ListDiffLines extends AbstractDiff |
@@ -384,7 +384,7 @@ |
||
| 384 | 384 | { |
| 385 | 385 | $bufferDom = new DOMDocument(); |
| 386 | 386 | |
| 387 | - foreach($node->childNodes as $child) |
|
| 387 | + foreach ($node->childNodes as $child) |
|
| 388 | 388 | { |
| 389 | 389 | $bufferDom->appendChild($bufferDom->importNode($child, true)); |
| 390 | 390 | } |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | public function initPurifier($defaultPurifierSerializerCache = null) |
| 130 | 130 | { |
| 131 | 131 | if (null !== $this->purifierConfig) { |
| 132 | - $HTMLPurifierConfig = $this->purifierConfig; |
|
| 132 | + $HTMLPurifierConfig = $this->purifierConfig; |
|
| 133 | 133 | } else { |
| 134 | 134 | $HTMLPurifierConfig = HTMLPurifier_Config::createDefault(); |
| 135 | 135 | } |
@@ -130,10 +130,10 @@ discard block |
||
| 130 | 130 | if ($this->isTag($word)) { |
| 131 | 131 | $word = $this->stripTagAttributes($word); |
| 132 | 132 | } |
| 133 | - if (isset($this->wordIndices[ $word ])) { |
|
| 134 | - $this->wordIndices[ $word ][] = $i; |
|
| 133 | + if (isset($this->wordIndices[$word])) { |
|
| 134 | + $this->wordIndices[$word][] = $i; |
|
| 135 | 135 | } else { |
| 136 | - $this->wordIndices[ $word ] = array($i); |
|
| 136 | + $this->wordIndices[$word] = array($i); |
|
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | } |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | } else { |
| 550 | 550 | $firstOrDefault = false; |
| 551 | 551 | foreach ($this->config->getSpecialCaseOpeningTags() as $x) { |
| 552 | - if (preg_match($x, $words[ 0 ])) { |
|
| 552 | + if (preg_match($x, $words[0])) { |
|
| 553 | 553 | $firstOrDefault = $x; |
| 554 | 554 | break; |
| 555 | 555 | } |
@@ -557,13 +557,13 @@ discard block |
||
| 557 | 557 | if ($firstOrDefault) { |
| 558 | 558 | $specialCaseTagInjection = '<ins class="mod">'; |
| 559 | 559 | if ($tag == 'del') { |
| 560 | - unset($words[ 0 ]); |
|
| 560 | + unset($words[0]); |
|
| 561 | 561 | } |
| 562 | - } elseif (array_search($words[ 0 ], $this->config->getSpecialCaseClosingTags()) !== false) { |
|
| 562 | + } elseif (array_search($words[0], $this->config->getSpecialCaseClosingTags()) !== false) { |
|
| 563 | 563 | $specialCaseTagInjection = '</ins>'; |
| 564 | 564 | $specialCaseTagInjectionIsBefore = true; |
| 565 | 565 | if ($tag == 'del') { |
| 566 | - unset($words[ 0 ]); |
|
| 566 | + unset($words[0]); |
|
| 567 | 567 | } |
| 568 | 568 | } |
| 569 | 569 | } |
@@ -589,7 +589,7 @@ discard block |
||
| 589 | 589 | $workTag[0] = str_replace('>', ' class="diffmod">', $workTag[0]); |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | - var_dump($workTag[ 0 ]); |
|
| 592 | + var_dump($workTag[0]); |
|
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | $appendContent = implode('', $workTag).$specialCaseTagInjection; |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | $space = $this->stringUtil->strpos($word, ' ', 1); |
| 782 | 782 | |
| 783 | 783 | if ($space) { |
| 784 | - return '<' . $this->stringUtil->substr($word, 1, $space) . '>'; |
|
| 784 | + return '<'.$this->stringUtil->substr($word, 1, $space).'>'; |
|
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | return trim($word, '<>'); |
@@ -805,15 +805,15 @@ discard block |
||
| 805 | 805 | |
| 806 | 806 | for ($indexInOld = $startInOld; $indexInOld < $endInOld; ++$indexInOld) { |
| 807 | 807 | $newMatchLengthAt = array(); |
| 808 | - $index = $this->oldWords[ $indexInOld ]; |
|
| 808 | + $index = $this->oldWords[$indexInOld]; |
|
| 809 | 809 | if ($this->isTag($index)) { |
| 810 | 810 | $index = $this->stripTagAttributes($index); |
| 811 | 811 | } |
| 812 | - if (!isset($this->wordIndices[ $index ])) { |
|
| 812 | + if (!isset($this->wordIndices[$index])) { |
|
| 813 | 813 | $matchLengthAt = $newMatchLengthAt; |
| 814 | 814 | continue; |
| 815 | 815 | } |
| 816 | - foreach ($this->wordIndices[ $index ] as $indexInNew) { |
|
| 816 | + foreach ($this->wordIndices[$index] as $indexInNew) { |
|
| 817 | 817 | if ($indexInNew < $startInNew) { |
| 818 | 818 | continue; |
| 819 | 819 | } |
@@ -821,8 +821,8 @@ discard block |
||
| 821 | 821 | break; |
| 822 | 822 | } |
| 823 | 823 | |
| 824 | - $newMatchLength = (isset($matchLengthAt[ $indexInNew - 1 ]) ? $matchLengthAt[ $indexInNew - 1 ] : 0) + 1; |
|
| 825 | - $newMatchLengthAt[ $indexInNew ] = $newMatchLength; |
|
| 824 | + $newMatchLength = (isset($matchLengthAt[$indexInNew - 1]) ? $matchLengthAt[$indexInNew - 1] : 0) + 1; |
|
| 825 | + $newMatchLengthAt[$indexInNew] = $newMatchLength; |
|
| 826 | 826 | |
| 827 | 827 | if ($newMatchLength > $bestMatchSize || |
| 828 | 828 | ( |