Code Duplication    Length = 16-16 lines in 3 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 3 locations

@@ 280-295 (lines=16) @@
277
     * @param Operation $operation
278
     * @param string    $cssClass
279
     */
280
    protected function processInsertOperation($operation, $cssClass)
281
    {
282
        $text = array();
283
        foreach ($this->newWords as $pos => $s) {
284
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
285
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) {
286
                    foreach ($this->newIsolatedDiffTags[$pos] as $word) {
287
                        $text[] = $word;
288
                    }
289
                } else {
290
                    $text[] = $s;
291
                }
292
            }
293
        }
294
295
        $this->insertTag('ins', $cssClass, $text);
296
    }
297
298
    /**
@@ 302-317 (lines=16) @@
299
     * @param Operation $operation
300
     * @param string    $cssClass
301
     */
302
    protected function processDeleteOperation($operation, $cssClass)
303
    {
304
        $text = array();
305
        foreach ($this->oldWords as $pos => $s) {
306
            if ($pos >= $operation->startInOld && $pos < $operation->endInOld) {
307
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->oldIsolatedDiffTags[$pos])) {
308
                    foreach ($this->oldIsolatedDiffTags[$pos] as $word) {
309
                        $text[] = $word;
310
                    }
311
                } else {
312
                    $text[] = $s;
313
                }
314
            }
315
        }
316
        $this->insertTag('del', $cssClass, $text);
317
    }
318
319
    /**
320
     * @param Operation $operation
@@ 421-436 (lines=16) @@
418
    /**
419
     * @param Operation $operation
420
     */
421
    protected function processEqualOperation($operation)
422
    {
423
        $result = array();
424
        foreach ($this->newWords as $pos => $s) {
425
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
426
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) {
427
                    $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s);
428
                } else {
429
                    $result[] = $s;
430
                }
431
            }
432
        }
433
        $this->content .= implode('', $result);
434
    }
435
436
    /**
437
     * @param string $text
438
     * @param string $attribute
439
     *