Code Duplication    Length = 14-14 lines in 2 locations

src/Comparator/FormDiffService.php 2 locations

@@ 419-432 (lines=14) @@
416
     * @throws \Nnx\FormComparator\Comparator\CollectionDiffService\Exception\RuntimeException
417
     * @throws \Nnx\FormComparator\Comparator\Exception\DomainException
418
     */
419
    protected function runDeleteElementStrategy(ElementInterface $deletedElement, $prefixPath)
420
    {
421
        if ($deletedElement instanceof Collection) {
422
            $builder = $this->diffBuilderFactory(DiffElementBuilder::DELETE_COLLECTION_MODE);
423
            $builder->setSourceElement($deletedElement)
424
                ->setSourceLabel($deletedElement->getLabel())
425
                ->setPathToElement($prefixPath);
426
            $this->diff[] = $builder->build();
427
        } elseif ($deletedElement instanceof FieldsetInterface) {
428
            $this->markNestedElementsAsDeletedInFieldset($deletedElement, $prefixPath);
429
        } else {
430
            $this->createDeleteElementDiff($deletedElement, $prefixPath);
431
        }
432
    }
433
434
435
    /**
@@ 445-458 (lines=14) @@
442
     * @throws \Nnx\FormComparator\Comparator\CollectionDiffService\Exception\RuntimeException
443
     * @throws \Nnx\FormComparator\Comparator\Exception\DomainException
444
     */
445
    protected function runInsertedElementStrategy(ElementInterface $insertedElement, $prefixPath)
446
    {
447
        if ($insertedElement instanceof Collection) {
448
            $builder = $this->diffBuilderFactory(DiffElementBuilder::INSERT_COLLECTION_MODE);
449
            $builder->setSourceElement($insertedElement)
450
                ->setSourceLabel($insertedElement->getLabel())
451
                ->setPathToElement($prefixPath);
452
            $this->diff[] = $builder->build();
453
        } elseif ($insertedElement instanceof FieldsetInterface) {
454
            $this->markNestedElementsAsInsertedInFieldset($insertedElement, $prefixPath);
455
        } else {
456
            $this->createInsertedElementDiff($insertedElement, $prefixPath);
457
        }
458
    }
459
}
460