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 (in_array($s, $this->isolatedDiffTags) && 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 (in_array($s, $this->isolatedDiffTags) && 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
@@ 387-402 (lines=16) @@
384
    /**
385
     * @param Operation $operation
386
     */
387
    protected function processEqualOperation($operation)
388
    {
389
        $result = array();
390
        foreach ($this->newWords as $pos => $s) {
391
392
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
393
                if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) {
394
395
                    $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s);
396
                } else {
397
                    $result[] = $s;
398
                }
399
            }
400
        }
401
        $this->content .= implode( "", $result );
402
    }
403
404
    /**
405
     * @param string $text