@@ 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 | { |
@@ 118-139 (lines=22) @@ | ||
115 | /** |
|
116 | * @return string |
|
117 | */ |
|
118 | public function build() |
|
119 | { |
|
120 | if ($this->hasDiffCache() && $this->getDiffCache()->contains($this->oldText, $this->newText)) { |
|
121 | $this->content = $this->getDiffCache()->fetch($this->oldText, $this->newText); |
|
122 | ||
123 | return $this->content; |
|
124 | } |
|
125 | ||
126 | $this->buildTableDoms(); |
|
127 | ||
128 | $this->diffDom = new \DOMDocument(); |
|
129 | ||
130 | $this->indexCellValues($this->newTable); |
|
131 | ||
132 | $this->diffTableContent(); |
|
133 | ||
134 | if ($this->hasDiffCache()) { |
|
135 | $this->getDiffCache()->save($this->oldText, $this->newText, $this->content); |
|
136 | } |
|
137 | ||
138 | return $this->content; |
|
139 | } |
|
140 | ||
141 | protected function diffTableContent() |
|
142 | { |