Code Duplication    Length = 4-8 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

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