Code Duplication    Length = 14-14 lines in 2 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 2 locations

@@ 199-212 (lines=14) @@
196
     *
197
     * @return false|string
198
     */
199
    protected function isOpeningIsolatedDiffTag($item, $currentIsolatedDiffTag = null)
200
    {
201
        $tagsToMatch = $currentIsolatedDiffTag !== null
202
            ? array($currentIsolatedDiffTag => $this->config->getIsolatedDiffTagPlaceholder($currentIsolatedDiffTag))
203
            : $this->config->getIsolatedDiffTags();
204
        $pattern = '#<%s(\s+[^>]*)?>#iU';
205
        foreach ($tagsToMatch as $key => $value) {
206
            if (preg_match(sprintf($pattern, $key), $item)) {
207
                return $key;
208
            }
209
        }
210
211
        return false;
212
    }
213
214
    protected function isSelfClosingTag($text)
215
    {
@@ 225-238 (lines=14) @@
222
     *
223
     * @return false|string
224
     */
225
    protected function isClosingIsolatedDiffTag($item, $currentIsolatedDiffTag = null)
226
    {
227
        $tagsToMatch = $currentIsolatedDiffTag !== null
228
            ? array($currentIsolatedDiffTag => $this->config->getIsolatedDiffTagPlaceholder($currentIsolatedDiffTag))
229
            : $this->config->getIsolatedDiffTags();
230
        $pattern = '#</%s(\s+[^>]*)?>#iU';
231
        foreach ($tagsToMatch as $key => $value) {
232
            if (preg_match(sprintf($pattern, $key), $item)) {
233
                return $key;
234
            }
235
        }
236
237
        return false;
238
    }
239
240
    /**
241
     * @param Operation $operation