Code Duplication    Length = 16-16 lines in 3 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 3 locations

@@ 243-258 (lines=16) @@
240
     * @param Operation $operation
241
     * @param string    $cssClass
242
     */
243
    protected function processInsertOperation($operation, $cssClass)
244
    {
245
        $text = array();
246
        foreach ($this->newWords as $pos => $s) {
247
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
248
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) {
249
                    foreach ($this->newIsolatedDiffTags[$pos] as $word) {
250
                        $text[] = $word;
251
                    }
252
                } else {
253
                    $text[] = $s;
254
                }
255
            }
256
        }
257
        $this->insertTag( "ins", $cssClass, $text );
258
    }
259
260
    /**
261
     * @param Operation $operation
@@ 264-279 (lines=16) @@
261
     * @param Operation $operation
262
     * @param string    $cssClass
263
     */
264
    protected function processDeleteOperation($operation, $cssClass)
265
    {
266
        $text = array();
267
        foreach ($this->oldWords as $pos => $s) {
268
            if ($pos >= $operation->startInOld && $pos < $operation->endInOld) {
269
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->oldIsolatedDiffTags[$pos])) {
270
                    foreach ($this->oldIsolatedDiffTags[$pos] as $word) {
271
                        $text[] = $word;
272
                    }
273
                } else {
274
                    $text[] = $s;
275
                }
276
            }
277
        }
278
        $this->insertTag( "del", $cssClass, $text );
279
    }
280
281
    /**
282
     * @param Operation $operation
@@ 385-400 (lines=16) @@
382
    /**
383
     * @param Operation $operation
384
     */
385
    protected function processEqualOperation($operation)
386
    {
387
        $result = array();
388
        foreach ($this->newWords as $pos => $s) {
389
390
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
391
                if ($this->config->isIsolatedDiffTagPlaceholder($s) && isset($this->newIsolatedDiffTags[$pos])) {
392
393
                    $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s);
394
                } else {
395
                    $result[] = $s;
396
                }
397
            }
398
        }
399
        $this->content .= implode( "", $result );
400
    }
401
402
    /**
403
     * @param string $text