Code Duplication    Length = 16-16 lines in 3 locations

lib/Caxy/HtmlDiff/HtmlDiff.php 3 locations

@@ 176-191 (lines=16) @@
173
        $this->processInsertOperation( $operation, "diffmod" );
174
    }
175
176
    protected function processInsertOperation($operation, $cssClass)
177
    {
178
        $text = array();
179
        foreach ($this->newWords as $pos => $s) {
180
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
181
                if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) {
182
                    foreach ($this->newIsolatedDiffTags[$pos] as $word) {
183
                        $text[] = $word;
184
                    }
185
                } else {
186
                    $text[] = $s;
187
                }
188
            }
189
        }
190
        $this->insertTag( "ins", $cssClass, $text );
191
    }
192
193
    protected function processDeleteOperation($operation, $cssClass)
194
    {
@@ 193-208 (lines=16) @@
190
        $this->insertTag( "ins", $cssClass, $text );
191
    }
192
193
    protected function processDeleteOperation($operation, $cssClass)
194
    {
195
        $text = array();
196
        foreach ($this->oldWords as $pos => $s) {
197
            if ($pos >= $operation->startInOld && $pos < $operation->endInOld) {
198
                if (in_array($s, $this->isolatedDiffTags) && isset($this->oldIsolatedDiffTags[$pos])) {
199
                    foreach ($this->oldIsolatedDiffTags[$pos] as $word) {
200
                        $text[] = $word;
201
                    }
202
                } else {
203
                    $text[] = $s;
204
                }
205
            }
206
        }
207
        $this->insertTag( "del", $cssClass, $text );
208
    }
209
210
    /**
211
     * @param Operation $operation
@@ 294-309 (lines=16) @@
291
        return $this->diffElements($oldText, $newText);
292
    }
293
294
    protected function processEqualOperation($operation)
295
    {
296
        $result = array();
297
        foreach ($this->newWords as $pos => $s) {
298
299
            if ($pos >= $operation->startInNew && $pos < $operation->endInNew) {
300
                if (in_array($s, $this->isolatedDiffTags) && isset($this->newIsolatedDiffTags[$pos])) {
301
302
                    $result[] = $this->diffIsolatedPlaceholder($operation, $pos, $s);
303
                } else {
304
                    $result[] = $s;
305
                }
306
            }
307
        }
308
        $this->content .= implode( "", $result );
309
    }
310
311
    /**
312
     * @param string $text