Code Duplication    Length = 16-16 lines in 3 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 3 locations

@@ 253-268 (lines=16) @@
250
     * @param Operation $operation
251
     * @param string    $cssClass
252
     */
253
    protected function processInsertOperation($operation, $cssClass)
254
    {
255
        $text = array();
256
        foreach ($this->newWords as $pos => $s) {
257
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
258
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) {
259
                    foreach ($this->newIsolatedDiffTags[$pos] as $word) {
260
                        $text[] = $word;
261
                    }
262
                } else {
263
                    $text[] = $s;
264
                }
265
            }
266
        }
267
        $this->insertTag( "ins", $cssClass, $text );
268
    }
269
270
    /**
271
     * @param Operation $operation
@@ 274-289 (lines=16) @@
271
     * @param Operation $operation
272
     * @param string    $cssClass
273
     */
274
    protected function processDeleteOperation($operation, $cssClass)
275
    {
276
        $text = array();
277
        foreach ($this->oldWords as $pos => $s) {
278
            if ($pos >= $operation->startInOld && $pos < $operation->endInOld) {
279
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->oldIsolatedDiffTags[$pos])) {
280
                    foreach ($this->oldIsolatedDiffTags[$pos] as $word) {
281
                        $text[] = $word;
282
                    }
283
                } else {
284
                    $text[] = $s;
285
                }
286
            }
287
        }
288
        $this->insertTag( "del", $cssClass, $text );
289
    }
290
291
    /**
292
     * @param Operation $operation
@@ 395-410 (lines=16) @@
392
    /**
393
     * @param Operation $operation
394
     */
395
    protected function processEqualOperation($operation)
396
    {
397
        $result = array();
398
        foreach ($this->newWords as $pos => $s) {
399
400
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
401
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) {
402
403
                    $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s);
404
                } else {
405
                    $result[] = $s;
406
                }
407
            }
408
        }
409
        $this->content .= implode( "", $result );
410
    }
411
412
    /**
413
     * @param string $text