Code Duplication    Length = 4-8 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

@@ 157-164 (lines=8) @@
154
            $openIsolatedDiffTag = $this->isOpeningIsolatedDiffTag($word, $currentIsolatedDiffTag);
155
            if ($openIsolatedDiffTag) {
156
                if ($this->isSelfClosingTag($word) || stripos($word, '<img') !== false) {
157
                    if ($openIsolatedDiffTags === 0) {
158
                        $isolatedDiffTagIndices[] = array(
159
                            'start'   => $index,
160
                            'length'  => 1,
161
                            'tagType' => $openIsolatedDiffTag,
162
                        );
163
                        $currentIsolatedDiffTag = null;
164
                    }
165
                } else {
166
                    if ($openIsolatedDiffTags === 0) {
167
                        $isolatedDiffTagStart = $index;
@@ 174-177 (lines=4) @@
171
                }
172
            } elseif ($openIsolatedDiffTags > 0 && $this->isClosingIsolatedDiffTag($word, $currentIsolatedDiffTag)) {
173
                $openIsolatedDiffTags--;
174
                if ($openIsolatedDiffTags == 0) {
175
                    $isolatedDiffTagIndices[] = array ('start' => $isolatedDiffTagStart, 'length' => $index - $isolatedDiffTagStart + 1, 'tagType' => $currentIsolatedDiffTag);
176
                    $currentIsolatedDiffTag = null;
177
                }
178
            }
179
        }
180
        $isolatedDiffTagScript = array();