Code Duplication    Length = 21-22 lines in 2 locations

lib/Caxy/HtmlDiff/ListDiff.php 1 location

@@ 30-50 (lines=21) @@
27
        return $diff;
28
    }
29
30
    public function build()
31
    {
32
        if ($this->hasDiffCache() && $this->getDiffCache()->contains($this->oldText, $this->newText)) {
33
            $this->content = $this->getDiffCache()->fetch($this->oldText, $this->newText);
34
35
            return $this->content;
36
        }
37
38
        $this->splitInputsToWords();
39
40
        $this->content = $this->diffLists(
41
            $this->buildDiffList($this->oldWords),
42
            $this->buildDiffList($this->newWords)
43
        );
44
45
        if ($this->hasDiffCache()) {
46
            $this->getDiffCache()->save($this->oldText, $this->newText, $this->content);
47
        }
48
49
        return $this->content;
50
    }
51
52
    protected function diffLists(DiffList $oldList, DiffList $newList)
53
    {

lib/Caxy/HtmlDiff/Table/TableDiff.php 1 location

@@ 90-111 (lines=22) @@
87
    /**
88
     * @return string
89
     */
90
    public function build()
91
    {
92
        if ($this->hasDiffCache() && $this->getDiffCache()->contains($this->oldText, $this->newText)) {
93
            $this->content = $this->getDiffCache()->fetch($this->oldText, $this->newText);
94
95
            return $this->content;
96
        }
97
98
        $this->buildTableDoms();
99
100
        $this->diffDom = new \DOMDocument();
101
102
        $this->indexCellValues($this->newTable);
103
104
        $this->diffTableContent();
105
106
        if ($this->hasDiffCache()) {
107
            $this->getDiffCache()->save($this->oldText, $this->newText, $this->content);
108
        }
109
110
        return $this->content;
111
    }
112
113
    protected function diffTableContent()
114
    {