Code Duplication    Length = 4-8 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

@@ 152-159 (lines=8) @@
149
            $openIsolatedDiffTag = $this->isOpeningIsolatedDiffTag($word, $currentIsolatedDiffTag);
150
            if ($openIsolatedDiffTag) {
151
                if ($this->isSelfClosingTag($word) || stripos($word, '<img') !== false) {
152
                    if ($openIsolatedDiffTags === 0) {
153
                        $isolatedDiffTagIndices[] = array(
154
                            'start'   => $index,
155
                            'length'  => 1,
156
                            'tagType' => $openIsolatedDiffTag,
157
                        );
158
                        $currentIsolatedDiffTag = null;
159
                    }
160
                } else {
161
                    if ($openIsolatedDiffTags === 0) {
162
                        $isolatedDiffTagStart = $index;
@@ 169-172 (lines=4) @@
166
                }
167
            } elseif ($openIsolatedDiffTags > 0 && $this->isClosingIsolatedDiffTag($word, $currentIsolatedDiffTag)) {
168
                $openIsolatedDiffTags--;
169
                if ($openIsolatedDiffTags == 0) {
170
                    $isolatedDiffTagIndices[] = array ('start' => $isolatedDiffTagStart, 'length' => $index - $isolatedDiffTagStart + 1, 'tagType' => $currentIsolatedDiffTag);
171
                    $currentIsolatedDiffTag = null;
172
                }
173
            }
174
        }
175
        $isolatedDiffTagScript = array();